This commit is contained in:
Erik C. Thauvin 2017-04-18 00:52:56 -07:00
parent 199ecf1f46
commit a312b93bb8
8 changed files with 59 additions and 96 deletions

View file

@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) &amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="myName" value="Erik's Copyright Notice" />
</copyright>
</component>

11
.idea/copyright/profiles_settings.xml generated Normal file
View file

@ -0,0 +1,11 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="Source" copyright="Erik's Copyright Notice" />
</module2copyright>
<LanguageOptions name="Kotlin">
<option name="fileTypeOverride" value="3" />
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
</component>

73
.idea/misc.xml generated
View file

@ -1,79 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Java</id>
</State>
<State>
<id>Portability issuesJava</id>
</State>
</expanded-state>
<selected-state>
<State>
<id>Android</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.x" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.x" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/kobaltBuild/classes" /> <output url="file://$PROJECT_DIR$/kobaltBuild/classes" />
</component> </component>
<component name="masterDetails">
<states>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<last-edited>commons-logging-api</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8.x</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.19944212" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8.x</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.19944212" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project> </project>

3
.idea/scopes/Source.xml generated Normal file
View file

@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Source" pattern="file[kobalt-property-file]:src/main/kotlin//*.kt||file[kobalt-property-file]:src/test/kotlin//*.kt" />
</component>

View file

@ -15,7 +15,6 @@ val p = project {
version = "0.1" version = "0.1"
dependencies { dependencies {
// compile("com.beust:jcommander:1.68")
} }
dependenciesTest { dependenciesTest {
@ -42,11 +41,13 @@ val p = project {
entry(key = "date.nextMonth", value = "0", type = Types.DATE, unit = Units.MONTH, operation = Operations.ADD) entry(key = "date.nextMonth", value = "0", type = Types.DATE, unit = Units.MONTH, operation = Operations.ADD)
entry(key = "akey", value = "avalue") entry(key = "akey", value = "avalue")
entry(key = "adate", type = Types.DATE, value = "now") entry(key = "adate", type = Types.DATE, value = "now")
entry(key = "aint", type = Types.INT, default = "0", operation = Operations.ADD) entry(key = "anint", type = Types.INT, default = "0", operation = Operations.ADD)
entry(key = "formated.int", type = Types.INT, default = "0013", operation = Operations.ADD, pattern = "0000") entry(key = "formated.int", type = Types.INT, default = "0013", operation = Operations.ADD, pattern = "0000")
entry(key = "formated.date", type = Types.DATE, value = "now", pattern = "DDD HH:mm") entry(key = "formated.date", type = Types.DATE, value = "now", pattern = "DDD HH:mm")
entry(key = "formated.date-1", type = Types.DATE, default = "now", pattern="DDD", operation = Operations.SUBTRACT, value = "1") entry(key = "formated.date-1", type = Types.DATE, default = "now", pattern = "DDD",
entry(key = "formated.tomorrow", type = Types.DATE, default = "now", pattern="DDD", operation = Operations.ADD, value = "1") operation = Operations.SUBTRACT, value = "1")
entry(key = "progress", default = "", operation = Operations.ADD, value="1") entry(key = "formated.tomorrow", type = Types.DATE, default = "now", pattern = "DDD",
operation = Operations.ADD, value = "1")
entry(key = "progress", default = "", operation = Operations.ADD, value = "1")
} }
} }

View file

@ -1,8 +0,0 @@
package com.example
import org.testng.annotations.Test
class ExampleTest {
@Test
fun f() = println("Running test")
}

View file

@ -1,3 +1,34 @@
/*
* PropertyFilePlugin.kt
*
* Copyright (c) 2017, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of this project nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.thauvin.erik.kobalt.plugin.propertyfile package net.thauvin.erik.kobalt.plugin.propertyfile
import com.beust.kobalt.Plugins import com.beust.kobalt.Plugins
@ -110,7 +141,7 @@ class PropertyFilePlugin @Inject constructor(val configActor: ConfigActor<Proper
val value = currentValue(p.getProperty(entry.key), entry.value, entry.default, entry.operation) val value = currentValue(p.getProperty(entry.key), entry.value, entry.default, entry.operation)
val fmt = SimpleDateFormat(if (entry.pattern.isBlank()) { val fmt = SimpleDateFormat(if (entry.pattern.isBlank()) {
"yyyy/MM/dd HH:mm" "yyyy-MM-dd HH:mm"
} else { } else {
entry.pattern entry.pattern
}) })
@ -250,7 +281,7 @@ data class Entry(
@Directive @Directive
class PropertyFileConfig { class PropertyFileConfig {
var file: String = "" var file: String = ""
var comment: String = "PropertyFile Plugin for Kobalt" var comment: String? = null
val entries = arrayListOf<Entry>() val entries = arrayListOf<Entry>()
@Suppress("unused") @Suppress("unused")

View file

@ -1,8 +0,0 @@
package com.example
import org.testng.annotations.Test
class ExampleTest {
@Test
fun f() = println("Running test")
}