Skip to content

Commit 2018d85

Browse files
committed
replace javaCompile with javaCompileProvider in build templates
1 parent 674f766 commit 2018d85

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

mode/templates/ARBuildECJ.gradle.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ android {
3232
// https://github.com/bytedeco/javacpp/wiki/Gradle
3333
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html
3434
applicationVariants.all { variant ->
35-
variant.javaCompile.doFirst {
35+
variant.javaCompileProvider.get().doFirst {
3636
// The main class that runs the Eclipse batch compiler
3737
String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main'
3838

3939
// We construct the list of arguments needed by the batch compiler
4040
// https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm
4141
List<String> ecjArgs = ['-nowarn',
42-
'-source', variant.javaCompile.sourceCompatibility,
43-
'-target', variant.javaCompile.targetCompatibility,
44-
'-d', variant.javaCompile.destinationDir] as String[]
42+
'-source', variant.javaCompileProvider.get().sourceCompatibility,
43+
'-target', variant.javaCompileProvider.get().targetCompatibility,
44+
'-d', variant.javaCompileProvider.get().destinationDir] as String[]
4545

4646
// Set the debug attributes level according to the build target
4747
if (variant.name == 'debug') {
@@ -53,11 +53,11 @@ android {
5353
}
5454

5555
// Adding all the source files to the list of arguments
56-
ecjArgs += variant.javaCompile.source
56+
ecjArgs += variant.javaCompileProvider.get().source
5757

5858
// Add the Android jar to the classpath inherited from the task
5959
FileCollection ecjClasspath = files('@@target_platform@@/android.jar',
60-
variant.javaCompile.classpath)
60+
variant.javaCompileProvider.get().classpath)
6161

6262
// Running the JavaExec task, which requires the main class to run,
6363
// the classpath, and the list of arguments

mode/templates/AppBuildECJ.gradle.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ android {
3838
// https://github.com/bytedeco/javacpp/wiki/Gradle
3939
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html
4040
applicationVariants.all { variant ->
41-
variant.javaCompile.doFirst {
41+
variant.javaCompileProvider.get().doFirst {
4242
// The main class that runs the Eclipse batch compiler
4343
String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main'
4444

4545
// We construct the list of arguments needed by the batch compiler
4646
// https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm
4747
List<String> ecjArgs = ['-nowarn',
48-
'-source', variant.javaCompile.sourceCompatibility,
49-
'-target', variant.javaCompile.targetCompatibility,
50-
'-d', variant.javaCompile.destinationDir] as String[]
48+
'-source', variant.javaCompileProvider.get().sourceCompatibility,
49+
'-target', variant.javaCompileProvider.get().targetCompatibility,
50+
'-d', variant.javaCompileProvider.get().destinationDir] as String[]
5151

5252
// Set the debug attributes level according to the build target
5353
if (variant.name == 'debug') {
@@ -59,11 +59,11 @@ android {
5959
}
6060

6161
// Adding all the source files to the list of arguments
62-
ecjArgs += variant.javaCompile.source
62+
ecjArgs += variant.javaCompileProvider.get().source
6363

6464
// Add the Android jar to the classpath inherited from the task
6565
FileCollection ecjClasspath = files('@@target_platform@@/android.jar',
66-
variant.javaCompile.classpath)
66+
variant.javaCompileProvider.get().classpath)
6767

6868
// Running the JavaExec task, which requires the main class to run,
6969
// the classpath, and the list of arguments

mode/templates/VRBuildECJ.gradle.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ android {
3636
// https://github.com/bytedeco/javacpp/wiki/Gradle
3737
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html
3838
applicationVariants.all { variant ->
39-
variant.javaCompile.doFirst {
39+
variant.javaCompileProvider.get().doFirst {
4040
// The main class that runs the Eclipse batch compiler
4141
String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main'
4242

4343
// We construct the list of arguments needed by the batch compiler
4444
// https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm
4545
List<String> ecjArgs = ['-nowarn',
46-
'-source', variant.javaCompile.sourceCompatibility,
47-
'-target', variant.javaCompile.targetCompatibility,
48-
'-d', variant.javaCompile.destinationDir] as String[]
46+
'-source', variant.javaCompileProvider.get().sourceCompatibility,
47+
'-target', variant.javaCompileProvider.get().targetCompatibility,
48+
'-d', variant.javaCompileProvider.get().destinationDir] as String[]
4949

5050
// Set the debug attributes level according to the build target
5151
if (variant.name == 'debug') {
@@ -57,11 +57,11 @@ android {
5757
}
5858

5959
// Adding all the source files to the list of arguments
60-
ecjArgs += variant.javaCompile.source
60+
ecjArgs += variant.javaCompileProvider.get().source
6161

6262
// Add the Android jar to the classpath inherited from the task
6363
FileCollection ecjClasspath = files('@@target_platform@@/android.jar',
64-
variant.javaCompile.classpath)
64+
variant.javaCompileProvider.get().classpath)
6565

6666
// Running the JavaExec task, which requires the main class to run,
6767
// the classpath, and the list of arguments

mode/templates/WearBuildECJ.gradle.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ android {
3636
// https://github.com/bytedeco/javacpp/wiki/Gradle
3737
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html
3838
applicationVariants.all { variant ->
39-
variant.javaCompile.doFirst {
39+
variant.javaCompileProvider.get().doFirst {
4040
// The main class that runs the Eclipse batch compiler
4141
String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main'
4242

4343
// We construct the list of arguments needed by the batch compiler
4444
// https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm
4545
List<String> ecjArgs = ['-nowarn',
46-
'-source', variant.javaCompile.sourceCompatibility,
47-
'-target', variant.javaCompile.targetCompatibility,
48-
'-d', variant.javaCompile.destinationDir] as String[]
46+
'-source', variant.javaCompileProvider.get().sourceCompatibility,
47+
'-target', variant.javaCompileProvider.get().targetCompatibility,
48+
'-d', variant.javaCompileProvider.get().destinationDir] as String[]
4949

5050
// Set the debug attributes level according to the build target
5151
if (variant.name == 'debug') {
@@ -57,11 +57,11 @@ android {
5757
}
5858

5959
// Adding all the source files to the list of arguments
60-
ecjArgs += variant.javaCompile.source
60+
ecjArgs += variant.javaCompileProvider.get().source
6161

6262
// Add the Android jar to the classpath inherited from the task
6363
FileCollection ecjClasspath = files('@@target_platform@@/android.jar',
64-
variant.javaCompile.classpath)
64+
variant.javaCompileProvider.get().classpath)
6565

6666
// Running the JavaExec task, which requires the main class to run,
6767
// the classpath, and the list of arguments

0 commit comments

Comments
 (0)