@@ -55,7 +55,7 @@ allprojects {
5555 " -Xlint:-path" ,
5656 " -Xlint:processing" ,
5757 " -Xlint:rawtypes" ,
58- " -Xlint:- removal" ,
58+ " -Xlint:removal" ,
5959 " -Xlint:requires-automatic" ,
6060 " -Xlint:requires-transitive-automatic" ,
6161 " -Xlint:-serial" ,
@@ -66,18 +66,66 @@ allprojects {
6666 " -Xlint:try" ,
6767 " -Xlint:unchecked" ,
6868 " -Xlint:varargs" ,
69- " -Xlint:- preview" ,
69+ " -Xlint:preview" ,
7070 " -Xdoclint:all/protected" ,
7171 " -Xdoclint:-missing" ,
7272 " -Xdoclint:-accessibility" ,
7373 " -proc:none" , // proc:none was added because of LOG4J2-1925 / JDK-8186647
74-
75- " --enable-preview"
7674 ]
7775
7876 if (propertyOrDefault(" javac.failOnWarnings" , true ). toBoolean()) {
79- // disabled in this branch: options.compilerArgs += "-Werror"
77+ options. compilerArgs + = " -Werror"
78+ }
79+ }
80+ }
81+ }
82+
83+ configure(project(" :lucene:core" )) {
84+ plugins. withType(JavaPlugin ) {
85+ sourceSets {
86+ main19 {
87+ java {
88+ srcDirs = [' src/java19' ]
89+ }
90+ }
91+ }
92+
93+ configurations {
94+ // Inherit any dependencies from the main source set.
95+ main19Implementation. extendsFrom implementation
96+ }
97+
98+ dependencies {
99+ // We need the main classes to compile our Java 19 pieces.
100+ main19Implementation sourceSets. main. output
101+ }
102+
103+ tasks. named(' compileMain19Java' ). configure {
104+ /* This will work when JDK 19 comes out:
105+
106+ // select EA build:
107+ javaCompiler = javaToolchains.compilerFor {
108+ languageVersion = JavaLanguageVersion.of(19)
109+ vendor = JvmVendorSpec.ADOPTOPENJDK
110+ }
111+
112+ // undo alternative JDK support:
113+ options.forkOptions.javaHome = null
114+ */
115+
116+ sourceCompatibility = 19
117+ targetCompatibility = 19
118+ options. compilerArgs + = [" --release" , 19 as String , " --enable-preview" ]
119+ }
120+
121+ tasks. named(' jar' ). configure {
122+ into(' META-INF/versions/19' ) {
123+ from sourceSets. main19. output
80124 }
125+
126+ manifest. attributes(
127+ ' Multi-Release' : ' true'
128+ )
81129 }
82130 }
83131}
0 commit comments