Skip to content

Commit

Permalink
Changing structure to have kotlin submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
deannagarcia committed Mar 30, 2021
1 parent 438d777 commit 726241f
Show file tree
Hide file tree
Showing 1,735 changed files with 218,645 additions and 156 deletions.
19 changes: 0 additions & 19 deletions java/core/generate-test-sources-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<arg value="--java_out=${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_proto2_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_custom_options.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_enormous_descriptor.proto"/>
Expand All @@ -24,9 +22,6 @@
<arg value="${test.proto.dir}/com/google/protobuf/any_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/cached_field_size_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/deprecated_file.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/field_presence_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lazy_fields_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/lite_equals_and_hash.proto"/>
Expand All @@ -36,7 +31,6 @@
<arg value="${test.proto.dir}/com/google/protobuf/map_lite_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/map_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/message_lite_extension_util_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/nested_builders_test.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/nested_extension.proto"/>
Expand Down Expand Up @@ -64,17 +58,4 @@
<arg value="${test.proto.dir}/com/google/protobuf/nested_extension_lite.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/non_nested_extension_lite.proto"/>
</exec>
<exec executable="${protoc}">
<arg value="--kotlin_out=${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_proto2_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
</exec>

</project>
45 changes: 1 addition & 44 deletions java/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
efficient yet extensible format.
</description>

<properties>
<kotlin.version>1.4.31</kotlin.version>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -51,17 +47,6 @@
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -161,35 +146,7 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${generated.testsources.dir}</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>

<!-- OSGI bundle configuration -->
<plugin>
<groupId>org.apache.felix</groupId>
Expand Down
19 changes: 19 additions & 0 deletions java/kotlin-lite/generate-sources-build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<project name="generate-sources">
<echo message="Running protoc ..."/>
<mkdir dir="${generated.sources.dir}"/>
<exec executable="${protoc}">
<arg value="--java_out=lite:${generated.sources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="${protobuf.source.dir}/google/protobuf/any.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/api.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/duration.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/empty.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/field_mask.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/source_context.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/struct.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/timestamp.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/type.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/wrappers.proto"/>
</exec>
</project>

34 changes: 34 additions & 0 deletions java/kotlin-lite/generate-test-sources-build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<project name="generate-test-sources">
<mkdir dir="${generated.testsources.dir}"/>
<exec executable="${protoc}">
<arg value="--java_out=lite:${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.basedir}/java/kotlin/${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_lite_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import_lite.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import_public.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_import_public_lite.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_lite.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
</exec>
<exec executable="${protoc}">
<arg value="--kotlin_out=lite:${generated.testsources.dir}"/>
<arg value="--proto_path=${protobuf.source.dir}"/>
<arg value="--proto_path=${protobuf.basedir}/java/kotlin/${test.proto.dir}"/>
<arg value="--experimental_allow_proto3_optional"/>
<arg value="${protobuf.source.dir}/google/protobuf/map_lite_unittest.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_lite.proto"/>
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/evil_names_proto2.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/evil_names_proto3.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/example_extensible_message.proto"/>
<arg value="${protobuf.basedir}/java/kotlin/${test.proto.dir}/com/google/protobuf/multiple_files_proto3.proto"/>
</exec>
</project>
25 changes: 25 additions & 0 deletions java/kotlin-lite/lite.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Remove code enclosed by "BEGIN FULL-RUNTIME" and "END FULL-RUNTIME" to
# create the lite-only version of a test file.

BEGIN {
in_full_runtime = 0;
}

/BEGIN FULL-RUNTIME/ {
in_full_runtime = 1;
next;
}

/END FULL-RUNTIME/ {
in_full_runtime = 0;
next;
}

in_full_runtime {
# Skip full runtime code path.
next;
}

{
print;
}
Loading

0 comments on commit 726241f

Please sign in to comment.