CLeaned up examples.
This commit is contained in:
parent
5a422fe502
commit
8c5f4a72fa
17 changed files with 38 additions and 37 deletions
|
@ -1,2 +1,2 @@
|
|||
[*]
|
||||
insert_final_newline=true
|
||||
insert_final_newline = true
|
||||
|
|
|
@ -142,8 +142,8 @@ test {
|
|||
}
|
||||
|
||||
spotbugs {
|
||||
toolVersion = versions.spotbugs
|
||||
excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml")
|
||||
toolVersion.set("${versions.spotbugs}")
|
||||
excludeFilter.set(file("$projectDir/config/spotbugs/excludeFilter.xml"))
|
||||
}
|
||||
|
||||
tasks.withType(SpotBugsTask) {
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
# Version 1.0
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <arg ...>"
|
||||
exit 1
|
||||
echo "Usage: $0 <arg ...>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# set the examples directories
|
||||
declare -a examples=(
|
||||
"java"
|
||||
"kotlin")
|
||||
"java"
|
||||
"kotlin")
|
||||
|
||||
dir=$(dirname "$(readlink -f "$0")")
|
||||
cyan=$(tput setaf 6)
|
||||
|
@ -18,13 +18,12 @@ normal=$(tput sgr0)
|
|||
|
||||
i=0
|
||||
for ex in "${examples[@]}"; do
|
||||
if [ $i -ne 0 ]
|
||||
then
|
||||
read -p "Press [Enter] key to continue..."
|
||||
clear
|
||||
fi
|
||||
cd "$dir/$ex" || exit 1
|
||||
echo "> Project: ${cyan}${ex}${normal}"
|
||||
./gradlew --console=plain --no-build-cache clean "$@" || exit 1
|
||||
(( i++ ))
|
||||
if [ $i -ne 0 ]; then
|
||||
read -p "Press [Enter] key to continue..."
|
||||
clear
|
||||
fi
|
||||
cd "$dir/$ex" || exit 1
|
||||
echo "> Project: ${cyan}${ex}${normal}"
|
||||
./gradlew --console=plain --no-build-cache clean "$@" || exit 1
|
||||
((i++))
|
||||
done
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[*]
|
||||
insert_final_newline=true
|
||||
insert_final_newline = true
|
||||
|
|
|
@ -19,6 +19,7 @@ mainClassName = 'com.example.App'
|
|||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -28,7 +29,7 @@ dependencies {
|
|||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
|
||||
options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
|
||||
options.compilerArgs += ["-Asemver.project.dir=$projectDir"]
|
||||
}
|
||||
|
||||
task runExample(type: JavaExec) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
|
||||
public final class ExampleVersion {
|
||||
public static final String PROJECT = "Java Example";
|
||||
public static final Date BUILDDATE = new Date(1620017348087L);
|
||||
public static final Date BUILDDATE = new Date(1624066674216L);
|
||||
public static final String VERSION = "8.4.97-alpha+T800";
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Date;
|
|||
*/
|
||||
public final class GeneratedVersion {
|
||||
public static final String PROJECT = "Java App";
|
||||
public static final Date BUILDDATE = new Date(1620017348189L);
|
||||
public static final Date BUILDDATE = new Date(1624066674199L);
|
||||
public static final int MAJOR = 11;
|
||||
public static final int MINOR = 11;
|
||||
public static final int PATCH = 20;
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Locale;
|
||||
|
||||
@Version(properties = "example.properties", template = "example.mustache", className = "ExampleVersion",
|
||||
keysPrefix = "example.")
|
||||
keysPrefix = "example.")
|
||||
public final class Example {
|
||||
/**
|
||||
* Command line interface.
|
||||
|
@ -19,7 +19,7 @@ public final class Example {
|
|||
System.out.println("-- From Example -------------------------------------");
|
||||
|
||||
System.out.println(" " + ExampleVersion.PROJECT + ' ' + ExampleVersion.VERSION
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
|
||||
System.out.println("-----------------------------------------------------");
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[*]
|
||||
insert_final_newline=true
|
||||
insert_final_newline = true
|
||||
|
|
|
@ -31,6 +31,7 @@ kapt {
|
|||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -40,7 +41,7 @@ application {
|
|||
tasks {
|
||||
register("runJava", JavaExec::class) {
|
||||
group = "application"
|
||||
main = "com.example.JavaApp"
|
||||
mainClass.set("com.example.JavaApp")
|
||||
classpath = sourceSets.main.get().runtimeClasspath
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public final class JavaExample {
|
|||
System.out.println("-- From JavaExample -----------------------------------");
|
||||
|
||||
System.out.println(" " + ExampleVersion.PROJECT + ' ' + ExampleVersion.VERSION
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
|
||||
System.out.println("-------------------------------------------------------");
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.text.SimpleDateFormat
|
|||
import java.util.Locale
|
||||
|
||||
@Version(properties = "example.properties", type = "kt", template = "example.mustache", className = "ExampleVersion",
|
||||
keysPrefix = "example.")
|
||||
keysPrefix = "example.")
|
||||
class Example {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
@ -15,7 +15,7 @@ class Example {
|
|||
println("-------------------------------------------------------")
|
||||
|
||||
println(" ${ExampleVersion.PROJECT} ${ExampleVersion.VERSION} ("
|
||||
+ sdf.format(ExampleVersion.BUILDDATE) + ')')
|
||||
+ sdf.format(ExampleVersion.BUILDDATE) + ')')
|
||||
|
||||
println("-------------------------------------------------------")
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
[*]
|
||||
insert_final_newline=true
|
||||
insert_final_newline = true
|
||||
|
|
|
@ -27,6 +27,6 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/src/generated/java")
|
||||
options.compilerArgs += [ "-Asemver.project.dir=${projectDir}/example" ]
|
||||
options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
|
||||
options.compilerArgs += ["-Asemver.project.dir=${projectDir}/example"]
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Locale;
|
||||
|
||||
@Version(properties = "example.properties", template = "example.mustache", className = "ExampleVersion",
|
||||
keysPrefix = "example.")
|
||||
keysPrefix = "example.")
|
||||
public final class Example {
|
||||
/**
|
||||
* Command line interface.
|
||||
|
@ -19,7 +19,7 @@ public final class Example {
|
|||
System.out.println("-- From Example -------------------------------------");
|
||||
|
||||
System.out.println(" " + ExampleVersion.PROJECT + ' ' + ExampleVersion.VERSION
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
+ " (" + sdf.format(ExampleVersion.BUILDDATE) + ')');
|
||||
|
||||
System.out.println("-----------------------------------------------------");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue