Skip to content

Commit a6af976

Browse files
committed
Use compiler plugin instead of ant
Signed-off-by: Ryan Nett <[email protected]>
1 parent 5d0c66d commit a6af976

File tree

2 files changed

+30
-62
lines changed

2 files changed

+30
-62
lines changed

tensorflow-core/tensorflow-core-api/pom.xml

+16-47
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
<java.module.name>org.tensorflow.core.api</java.module.name>
2323
<ndarray.version>0.3.1</ndarray.version>
2424
<truth.version>1.0.1</truth.version>
25-
26-
<java9.sourceDirectory>${project.basedir}/src/main/java9</java9.sourceDirectory>
27-
<java9.build.outputDirectory>${project.build.directory}/classes-java9</java9.build.outputDirectory>
2825
</properties>
2926

3027
<dependencies>
@@ -146,50 +143,6 @@
146143
</execution>
147144
</executions>
148145
</plugin>
149-
<plugin>
150-
<groupId>org.apache.maven.plugins</groupId>
151-
<artifactId>maven-antrun-plugin</artifactId>
152-
<version>3.0.0</version>
153-
<executions>
154-
<execution>
155-
<id>compile-java9</id>
156-
<phase>compile</phase>
157-
<configuration>
158-
<target>
159-
<mkdir dir="${java9.build.outputDirectory}" />
160-
<javac srcdir="${java9.sourceDirectory}" destdir="${java9.build.outputDirectory}"
161-
classpath="${project.build.outputDirectory}" includeantruntime="false"
162-
target="9" source="9" release="9"/>
163-
</target>
164-
</configuration>
165-
<goals>
166-
<goal>run</goal>
167-
</goals>
168-
</execution>
169-
</executions>
170-
</plugin>
171-
<plugin>
172-
<groupId>org.apache.maven.plugins</groupId>
173-
<artifactId>maven-resources-plugin</artifactId>
174-
<version>3.2.0</version>
175-
<executions>
176-
<execution>
177-
<id>copy-resources</id>
178-
<phase>prepare-package</phase>
179-
<goals>
180-
<goal>copy-resources</goal>
181-
</goals>
182-
<configuration>
183-
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/9</outputDirectory>
184-
<resources>
185-
<resource>
186-
<directory>${java9.build.outputDirectory}</directory>
187-
</resource>
188-
</resources>
189-
</configuration>
190-
</execution>
191-
</executions>
192-
</plugin>
193146
<plugin>
194147
<artifactId>maven-compiler-plugin</artifactId>
195148
<version>3.8.0</version>
@@ -216,6 +169,22 @@
216169
<generatedSourcesDirectory>${project.basedir}/src/gen/annotations</generatedSourcesDirectory>
217170
</configuration>
218171
</execution>
172+
<execution>
173+
<id>compile-java-9</id>
174+
<phase>compile</phase>
175+
<goals>
176+
<goal>compile</goal>
177+
</goals>
178+
<configuration>
179+
<release>9</release>
180+
<source>9</source>
181+
<target>9</target>
182+
<compileSourceRoots>
183+
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
184+
</compileSourceRoots>
185+
<multiReleaseOutput>true</multiReleaseOutput>
186+
</configuration>
187+
</execution>
219188
<!--
220189
Compile JavaCPP presets
221190
This must be done prematurely, at the generate-sources phase, since the javacpp-plugin
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/*
2-
Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2+
Copyright 2021 The TensorFlow Authors. All Rights Reserved.
33
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
=======================================================================
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
=======================================================================
1616
17-
*/
17+
*/
1818
package org.tensorflow;
1919

2020
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -24,15 +24,14 @@
2424
public class MultiReleaseTest {
2525

2626
@Test
27-
public void testMultirelease(){
27+
public void testMultirelease() {
2828
String javaVersion = System.getProperty("java.version");
2929
System.out.println("Testing on Java version " + javaVersion);
3030
int value = MRTest.version();
31-
if(javaVersion.compareTo("9") >= 0){
31+
if (javaVersion.compareTo("9") >= 0) {
3232
assertEquals(9, value);
3333
} else {
3434
assertEquals(8, value);
3535
}
3636
}
37-
3837
}

0 commit comments

Comments
 (0)