More examples testing.
This commit is contained in:
parent
c7d46bfd7a
commit
f4f0ce42ae
12 changed files with 50 additions and 38 deletions
|
@ -3,9 +3,7 @@
|
|||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output-test url="file://$MODULE_DIR$/../../../../examples/annotation-processor/java/out/test/classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../../../examples/annotation-processor/java/src/test">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../../examples/annotation-processor/java/src/test/java" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../../../examples/annotation-processor/java/src/test" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="annotation-processor-java_main" />
|
||||
|
|
4
.idea/modules/ap-examples-java_test.iml
generated
4
.idea/modules/ap-examples-java_test.iml
generated
|
@ -3,9 +3,7 @@
|
|||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output-test url="file://$MODULE_DIR$/../../examples/annotation-processor/java/out/test/classes" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../examples/annotation-processor/java/src/test">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../examples/annotation-processor/java/src/test/java" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../examples/annotation-processor/java/src/test" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="ap-examples-java_main" />
|
||||
|
|
1
.idea/modules/examples.iml
generated
1
.idea/modules/examples.iml
generated
|
@ -8,5 +8,6 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="groovy-2.5.0" level="application" />
|
||||
</component>
|
||||
</module>
|
3
examples/test/.gitignore
vendored
3
examples/test/.gitignore
vendored
|
@ -3,8 +3,9 @@
|
|||
**/.idea/libraries
|
||||
**/.idea/tasks.xml
|
||||
**/.idea/workspace.xml
|
||||
*.sublime-*
|
||||
*.iws
|
||||
*.properties
|
||||
*.sublime-*
|
||||
.classpath
|
||||
.DS_Store
|
||||
.gradle
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
// plugins {
|
||||
// id 'java'
|
||||
// id 'application'
|
||||
// id "net.thauvin.erik.gradle.semver" version "0.9.4-beta"
|
||||
// }
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath "net.thauvin.erik.gradle:semver:0.9.4-beta"
|
||||
classpath "net.thauvin.erik.gradle:semver:0.9.5-beta"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +20,8 @@ mainClassName = 'App'
|
|||
|
||||
version = 1.0
|
||||
|
||||
def f = new File("test.properties")
|
||||
|
||||
dependencies {
|
||||
|
||||
}
|
||||
|
@ -23,21 +30,26 @@ repositories {
|
|||
jcenter()
|
||||
}
|
||||
|
||||
task cleanVersion {
|
||||
delete "test.properties"
|
||||
clean {
|
||||
delete fileTree(dir: "$projectDir", include: "*.properties")
|
||||
}
|
||||
|
||||
clean.dependsOn("cleanVersion")
|
||||
incrementPatch {
|
||||
doFirst {
|
||||
println("[Gradle] exists: " + f.exists() + ", canRead: " + f.canRead())
|
||||
}
|
||||
}
|
||||
|
||||
run {
|
||||
//dependsOn("incrementPatch")
|
||||
//dependsOn("incrementPatch")
|
||||
doFirst {
|
||||
println("Version: $version")
|
||||
args = [f.name]
|
||||
}
|
||||
}
|
||||
|
||||
semver {
|
||||
properties = "$projectDir/example.properties"
|
||||
keysPrefix = "example."
|
||||
properties = "$projectDir/${f.name}"
|
||||
keysPrefix = f.name.substring(0, f.name.indexOf(".") + 1)
|
||||
buildMetaKey = "meta"
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
#Generated by the Semver Plugin for Gradle
|
||||
#Tue Jul 03 13:33:49 PDT 2018
|
||||
example.major=2
|
||||
example.meta=007
|
||||
example.prerelease=beta
|
||||
example.minor=1
|
||||
example.patch=12
|
Binary file not shown.
|
@ -1,12 +1,21 @@
|
|||
/*
|
||||
* This Java source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
public class App {
|
||||
public String getGreeting() {
|
||||
return "Hello world.";
|
||||
public static void main(String[] args) {
|
||||
new App().cat(args[0]);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(new App().getGreeting());
|
||||
public void cat(String name) {
|
||||
try {
|
||||
final List<String> content = Files.readAllLines(Paths.get(name));
|
||||
for (String line : content) {
|
||||
if (!line.startsWith("#")) System.out.println(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +1,14 @@
|
|||
/*
|
||||
* This Java source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class AppTest {
|
||||
@Test public void testAppHasAGreeting() {
|
||||
@Test
|
||||
public void testAppHasAGreeting() {
|
||||
App classUnderTest = new App();
|
||||
assertNotNull("app should have a greeting", classUnderTest.getGreeting());
|
||||
}
|
||||
|
|
4
examples/test/test.groovy
Normal file
4
examples/test/test.groovy
Normal file
|
@ -0,0 +1,4 @@
|
|||
f = new File("K:\\kotlin\\semver-gradle\\examples\\test\\examples.properties")
|
||||
println(f.absoluteFile)
|
||||
println(f.exists())
|
||||
println(f.canRead())
|
|
@ -1,7 +0,0 @@
|
|||
#Generated by the Semver Plugin for Gradle
|
||||
#Mon Jul 02 22:37:14 PDT 2018
|
||||
version.prerelease=
|
||||
version.buildmeta=
|
||||
version.patch=3
|
||||
version.major=1
|
||||
version.minor=0
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by the Semver Plugin for Gradle
|
||||
#Tue Jul 03 13:33:49 PDT 2018
|
||||
#Tue Jul 03 14:16:07 PDT 2018
|
||||
version.prerelease=
|
||||
version.buildmeta=
|
||||
version.patch=0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue