File tree Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change
1
+ import java.util.Properties
2
+ import groovy.lang.MissingPropertyException
3
+
1
4
plugins {
2
5
`kotlin- dsl`
3
6
}
@@ -7,10 +10,23 @@ repositories {
7
10
gradlePluginPortal()
8
11
}
9
12
10
- // Use JDK 11 for compiling the convention plugins (this is NOT the project!)
13
+ // Use the same Java version for compiling the convention plugins as for the main project
14
+ // For this we need to manually load the gradle.properties, since variables from the main
15
+ // project are generally not visible from buildSrc.
16
+
17
+ val javaVersionProperty = " javaVersion"
18
+ val javaVersion = try {
19
+ project.property(javaVersionProperty) as String
20
+ } catch (e: MissingPropertyException ) {
21
+ Properties ().also { properties ->
22
+ File (" $rootDir /../gradle.properties" ).inputStream().use { stream ->
23
+ properties.load(stream)
24
+ }
25
+ }[javaVersionProperty] as String
26
+ }
11
27
12
28
kotlin {
13
- jvmToolchain(11 )
29
+ jvmToolchain(javaVersion.toInt() )
14
30
}
15
31
16
32
dependencies {
Original file line number Diff line number Diff line change 1
1
config :
2
2
validation : true # verifies that this config file is valid
3
3
warningsAsErrors : false
4
+
5
+ exceptions :
6
+ SwallowedException :
7
+ ignoredExceptionTypes :
8
+ - InterruptedException
9
+ - MalformedURLException
10
+ - NumberFormatException
11
+ - ParseException
12
+ - MissingPropertyException
Original file line number Diff line number Diff line change 1
- import groovy.lang.MissingPropertyException
2
-
3
1
plugins {
4
2
kotlin(" jvm" )
5
3
id(" maven-publish" )
Original file line number Diff line number Diff line change 1
- import groovy.lang.MissingPropertyException
2
-
3
1
plugins {
4
2
id(" maven-publish" )
5
3
kotlin(" jvm" )
You can’t perform that action at this time.
0 commit comments