Skip to content

Commit 5dfb217

Browse files
committed
Restructure Kotlin projects
Signed-off-by: Ryan Nett <[email protected]>
1 parent 274910b commit 5dfb217

File tree

43 files changed

+1103
-981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1103
-981
lines changed

pom.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
2-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33

44
<modelVersion>4.0.0</modelVersion>
55

@@ -31,7 +31,7 @@
3131
<modules>
3232
<module>ndarray</module>
3333
<module>tensorflow-core</module>
34-
<module>tensorflow-core-kotlin</module>
34+
<module>tensorflow-kotlin-parent</module>
3535
<module>tensorflow-framework</module>
3636
</modules>
3737

@@ -104,19 +104,19 @@
104104
<artifactId>junit-jupiter-engine</artifactId>
105105
<version>${junit.version}</version>
106106
<scope>test</scope>
107-
</dependency>
108-
<dependency>
109-
<groupId>org.openjdk.jmh</groupId>
110-
<artifactId>jmh-core</artifactId>
111-
<version>${jmh.version}</version>
112-
<scope>test</scope>
113-
</dependency>
114-
<dependency>
115-
<groupId>org.openjdk.jmh</groupId>
116-
<artifactId>jmh-generator-annprocess</artifactId>
117-
<version>${jmh.version}</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.openjdk.jmh</groupId>
110+
<artifactId>jmh-core</artifactId>
111+
<version>${jmh.version}</version>
112+
<scope>test</scope>
113+
</dependency>
114+
<dependency>
115+
<groupId>org.openjdk.jmh</groupId>
116+
<artifactId>jmh-generator-annprocess</artifactId>
117+
<version>${jmh.version}</version>
118118
<scope>test</scope>
119-
</dependency>
119+
</dependency>
120120
</dependencies>
121121
</dependencyManagement>
122122

tensorflow-core-kotlin/tensorflow-core-kotlin-api/.editorconfig

Lines changed: 0 additions & 4 deletions
This file was deleted.

tensorflow-core-kotlin/tensorflow-core-kotlin-generator/pom.xml

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*.{kt, kts}]
4+
indent_size = 4
5+
insert_final_newline = true
6+
max_line_length = 120

tensorflow-core-kotlin/README.md renamed to tensorflow-kotlin-parent/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Kotlin API
22

3-
This is the home of the Kotlin API for TensorFlow Java.
4-
The API lives in `tensorflow-core-api`, and uses the annotation processor in `tensorflow-core-generator`.
3+
This is the home of the Kotlin API for TensorFlow Java. The API lives in `tensorflow-core-api`, and uses the annotation processor in `tensorflow-core-generator`.
54

65
There is no framework wrapper yet, as most of the framework classes work fine from Kotlin, but if there is a need one could be addded.
76

tensorflow-kotlin-parent/pom.xml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!--
2+
Copyright 2020 The TensorFlow Authors. All Rights Reserved.
3+
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
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
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+
=======================================================================
16+
-->
17+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
19+
20+
<modelVersion>4.0.0</modelVersion>
21+
22+
<parent>
23+
<groupId>org.tensorflow</groupId>
24+
<artifactId>tensorflow-java</artifactId>
25+
<version>0.4.0-SNAPSHOT</version>
26+
</parent>
27+
<artifactId>tensorflow-kotlin-parent</artifactId>
28+
<packaging>pom</packaging>
29+
30+
<name>TensorFlow Kotlin Parent</name>
31+
<description>Parent POM of TensorFlow Kotlin artifacts</description>
32+
33+
<modules>
34+
<module>tensorflow-kotlin-generator</module>
35+
<module>tensorflow-core-kotlin</module>
36+
<module>tensorflow-framework-kotlin</module>
37+
<module>tensorflow-kotlin</module>
38+
</modules>
39+
40+
<dependencies>
41+
<dependency>
42+
<groupId>org.jetbrains.kotlin</groupId>
43+
<artifactId>kotlin-stdlib-jdk8</artifactId>
44+
<version>${kotlin.version}</version>
45+
</dependency>
46+
</dependencies>
47+
48+
<properties>
49+
<kotlin.version>1.4.32</kotlin.version>
50+
<kotlin.jvmTarget>1.8</kotlin.jvmTarget>
51+
</properties>
52+
53+
<profiles>
54+
<profile>
55+
<id>jdk11</id>
56+
<properties>
57+
<kotlin.jvmTarget>11</kotlin.jvmTarget>
58+
</properties>
59+
</profile>
60+
</profiles>
61+
62+
<build>
63+
<plugins>
64+
<plugin>
65+
<groupId>org.jetbrains.kotlin</groupId>
66+
<artifactId>kotlin-maven-plugin</artifactId>
67+
<version>${kotlin.version}</version>
68+
<configuration>
69+
<jvmTarget>${kotlin.jvmTarget}</jvmTarget>
70+
</configuration>
71+
72+
<executions>
73+
<execution>
74+
<id>compile</id>
75+
<goals>
76+
<goal>compile</goal>
77+
</goals>
78+
</execution>
79+
80+
<execution>
81+
<id>test-compile</id>
82+
<goals>
83+
<goal>test-compile</goal>
84+
</goals>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
</project>
91+

tensorflow-core-kotlin/tensorflow-core-kotlin-api/pom.xml renamed to tensorflow-kotlin-parent/tensorflow-core-kotlin/pom.xml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
<parent>
2323
<groupId>org.tensorflow</groupId>
24-
<artifactId>tensorflow-core-kotlin</artifactId>
24+
<artifactId>tensorflow-kotlin-parent</artifactId>
2525
<version>0.4.0-SNAPSHOT</version>
2626
</parent>
27-
<artifactId>tensorflow-core-kotlin-api</artifactId>
27+
<artifactId>tensorflow-core-kotlin</artifactId>
2828
<packaging>jar</packaging>
2929

30-
<name>TensorFlow Core Kotlin API Library</name>
30+
<name>TensorFlow Core Kotlin Library</name>
3131
<description>Kotlin API wrappers for the TensorFlow core Java library</description>
3232

3333
<properties>
@@ -63,7 +63,7 @@
6363
<dependency>
6464
<groupId>org.jetbrains.kotlin</groupId>
6565
<artifactId>kotlin-test-junit5</artifactId>
66-
<version>1.4.31</version>
66+
<version>${kotlin.version}</version>
6767
<scope>test</scope>
6868
</dependency>
6969
<!-- Include native binaries dependencies only for testing -->
@@ -111,9 +111,7 @@
111111
<arg>-Xopt-in=kotlin.contracts.ExperimentalContracts</arg>
112112
<arg>-Xexplicit-api=strict</arg>
113113
</args>
114-
<jvmTarget>${kotlin.jvmTarget}</jvmTarget>
115114
</configuration>
116-
117115
<executions>
118116
<execution>
119117
<id>kapt</id>
@@ -123,6 +121,7 @@
123121
<configuration>
124122
<sourceDirs>
125123
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
124+
<sourceDir>${project.basedir}/src/gen/annotations</sourceDir>
126125
<sourceDir>${project.basedir}/../../tensorflow-core/tensorflow-core-api/src/gen/java</sourceDir>
127126
<sourceDir>${project.basedir}/../../tensorflow-core/tensorflow-core-api/src/gen/annotations</sourceDir>
128127
<sourceDir>${project.basedir}/../../tensorflow-core/tensorflow-core-api/src/main/java</sourceDir>
@@ -131,28 +130,14 @@
131130
<annotationProcessor>org.tensorflow.processor.operator.KotlinOpsProcessor</annotationProcessor>
132131
</annotationProcessors>
133132
<annotationProcessorPaths>
134-
<!-- Specify your annotation processors here. -->
135133
<annotationProcessorPath>
136134
<groupId>org.tensorflow</groupId>
137-
<artifactId>tensorflow-core-kotlin-generator</artifactId>
135+
<artifactId>tensorflow-kotlin-generator</artifactId>
138136
<version>${project.version}</version>
139137
</annotationProcessorPath>
140138
</annotationProcessorPaths>
141139
</configuration>
142140
</execution>
143-
<execution>
144-
<id>compile</id>
145-
<goals>
146-
<goal>compile</goal>
147-
</goals>
148-
</execution>
149-
150-
<execution>
151-
<id>test-compile</id>
152-
<goals>
153-
<goal>test-compile</goal>
154-
</goals>
155-
</execution>
156141
</executions>
157142
</plugin>
158143
<plugin>
@@ -231,11 +216,11 @@
231216
<groupId>org.apache.maven.plugins</groupId>
232217
<artifactId>maven-surefire-plugin</artifactId>
233218
<version>2.22.2</version>
234-
<!-- <configuration>-->
235-
<!-- <forkCount>1</forkCount>-->
236-
<!-- <reuseForks>false</reuseForks>-->
237-
<!-- <argLine>-Xmx2G -XX:MaxPermSize=256m</argLine>-->
238-
<!-- </configuration>-->
219+
<!-- <configuration>-->
220+
<!-- <forkCount>1</forkCount>-->
221+
<!-- <reuseForks>false</reuseForks>-->
222+
<!-- <argLine>-Xmx2G -XX:MaxPermSize=256m</argLine>-->
223+
<!-- </configuration>-->
239224
</plugin>
240225
</plugins>
241226
</build>

0 commit comments

Comments
 (0)