Skip to content
Snippets Groups Projects
Commit 4468394c authored by Thai Duong's avatar Thai Duong
Browse files

Readd android targets.

Change-Id: I5f4542ee79236cada3cf8232c835cf0493238b73
ORIGINAL_AUTHOR=Thai Duong <thaidn@google.com>
GitOrigin-RevId: a881f8f3c71a35dfef3bfa6bc69f5392671ced9e
parent 2bb522f7
No related branches found
No related tags found
No related merge requests found
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:private"])
licenses(["notice"]) # Apache 2.0 licenses(["notice"]) # Apache 2.0
...@@ -25,12 +25,12 @@ java_library( ...@@ -25,12 +25,12 @@ java_library(
name = "android", name = "android",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
exports = [ exports = [
"//java/src/main/java/com/google/crypto/tink", "//java/src/main/java/com/google/crypto/tink:android",
"//java/src/main/java/com/google/crypto/tink/aead", "//java/src/main/java/com/google/crypto/tink/aead:android",
"//java/src/main/java/com/google/crypto/tink/hybrid", "//java/src/main/java/com/google/crypto/tink/hybrid:android",
"//java/src/main/java/com/google/crypto/tink/mac", "//java/src/main/java/com/google/crypto/tink/mac:android",
"//java/src/main/java/com/google/crypto/tink/signature", "//java/src/main/java/com/google/crypto/tink/signature:android",
"//java/src/main/java/com/google/crypto/tink/streamingaead", "//java/src/main/java/com/google/crypto/tink/streamingaead:android",
], ],
) )
...@@ -89,13 +89,14 @@ LITE_PROTOS = [ ...@@ -89,13 +89,14 @@ LITE_PROTOS = [
java_library( java_library(
name = "protos", name = "protos",
visibility = [ visibility = [
"//examples/java/envelopeme:__pkg__",
"//tools/tinkey:__pkg__", "//tools/tinkey:__pkg__",
], ],
exports = select({ exports = FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "protos_android",
exports = LITE_PROTOS,
) )
java_library( java_library(
...@@ -109,6 +110,17 @@ java_library( ...@@ -109,6 +110,17 @@ java_library(
], ],
) )
java_library(
name = "cleartext_keyset_handle_android",
visibility = [
"//tools/testing:__subpackages__",
"//tools/tinkey:__pkg__",
],
exports = [
"//java/src/main/java/com/google/crypto/tink:cleartext_keyset_handle_android",
],
)
# TEST # TEST
java_library( java_library(
...@@ -131,8 +143,8 @@ java_library( ...@@ -131,8 +143,8 @@ java_library(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
exports = [ exports = [
":android", ":android",
":cleartext_keyset_handle", ":cleartext_keyset_handle_android",
":protos", ":protos_android",
":subtle", ":subtle",
], ],
) )
......
...@@ -69,10 +69,18 @@ java_library( ...@@ -69,10 +69,18 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"@com_google_errorprone_error_prone_annotations//jar", "@com_google_errorprone_error_prone_annotations//jar",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [":tink_srcs"],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink/subtle",
"@com_google_errorprone_error_prone_annotations//jar",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
java_library( java_library(
...@@ -83,9 +91,18 @@ java_library( ...@@ -83,9 +91,18 @@ java_library(
javacopts = JAVACOPTS, javacopts = JAVACOPTS,
deps = [ deps = [
":tink", ":tink",
"@com_google_protobuf_java//:protobuf_java", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "cleartext_keyset_handle_android",
srcs = [
":cleartext_keyset_handle_srcs",
],
javacopts = JAVACOPTS,
deps = [
":android",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -53,8 +53,18 @@ java_library( ...@@ -53,8 +53,18 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:aead", "//java/src/main/java/com/google/crypto/tink/subtle:aead",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [":aead_srcs"],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink",
"//java/src/main/java/com/google/crypto/tink/mac:android",
"//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:aead",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -50,8 +50,21 @@ java_library( ...@@ -50,8 +50,21 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:hybrid", "//java/src/main/java/com/google/crypto/tink/subtle:hybrid",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [
":hybrid_srcs",
],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink:android",
"//java/src/main/java/com/google/crypto/tink/aead:android",
"//java/src/main/java/com/google/crypto/tink/mac:android",
"//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:hybrid",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -38,8 +38,17 @@ java_library( ...@@ -38,8 +38,17 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:mac", "//java/src/main/java/com/google/crypto/tink/subtle:mac",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [":mac_srcs"],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink:android",
"//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:mac",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -40,8 +40,17 @@ java_library( ...@@ -40,8 +40,17 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:signature", "//java/src/main/java/com/google/crypto/tink/subtle:signature",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [":signature_srcs"],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink:android",
"//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:signature",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -40,8 +40,17 @@ java_library( ...@@ -40,8 +40,17 @@ java_library(
"//java/src/main/java/com/google/crypto/tink/subtle", "//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:streaming", "//java/src/main/java/com/google/crypto/tink/subtle:streaming",
"@com_google_protobuf_javalite//:protobuf_java_lite", "@com_google_protobuf_javalite//:protobuf_java_lite",
] + select({ ] + FULL_PROTOS,
"//java/build_defs:use_java_proto_full": FULL_PROTOS, )
"//conditions:default": LITE_PROTOS,
}), java_library(
name = "android",
srcs = [":streamingaead_srcs"],
javacopts = JAVACOPTS,
deps = [
"//java/src/main/java/com/google/crypto/tink:android",
"//java/src/main/java/com/google/crypto/tink/subtle",
"//java/src/main/java/com/google/crypto/tink/subtle:streaming",
"@com_google_protobuf_javalite//:protobuf_java_lite",
] + LITE_PROTOS,
) )
...@@ -33,8 +33,6 @@ bazel build --strategy=CppCompile=standalone --strategy=Turbine=standalone \ ...@@ -33,8 +33,6 @@ bazel build --strategy=CppCompile=standalone --strategy=Turbine=standalone \
--strategy=GenRule=standalone --strategy=GenProtoDescriptorSet=standalone \ --strategy=GenRule=standalone --strategy=GenProtoDescriptorSet=standalone \
--sandbox_tmpfs_path=$TMP -- //... -//objc/... -//tools/... --sandbox_tmpfs_path=$TMP -- //... -//objc/... -//tools/...
# Run all tests, except Tinkey and iOS. # Run all tests, except iOS.
bazel test --strategy=TestRunner=standalone --test_output=all -- //... -//objc/... -//tools/... bazel test --strategy=TestRunner=standalone --test_output=all -- //... \
-//objc/...
# Run Tinkey tests, with full protos.
bazel test --strategy=TestRunner=standalone --test_output=all --define use_java_proto_full=true -- //tools/... -//objc/...
...@@ -71,12 +71,9 @@ ${BAZEL_BIN} test \ ...@@ -71,12 +71,9 @@ ${BAZEL_BIN} test \
echo "bazel obj-c passed" echo "bazel obj-c passed"
# Test all targets except Tinkey and iOS. # Test all targets except iOS.
# bazel sandbox doesn't work with Kokoro's MacOS image, see b/38040081. # bazel sandbox doesn't work with Kokoro's MacOS image, see b/38040081.
${BAZEL_BIN} test --sandbox_tmpfs_path=$TMP $DISABLE_SANDBOX -- //... -//objc/... -//tools/... || ( ls -l ; df -h / ; exit 1 ) ${BAZEL_BIN} test --sandbox_tmpfs_path=$TMP $DISABLE_SANDBOX -- //... \
-//objc/... || ( ls -l ; df -h / ; exit 1 )
# Run all Tinkey tests, with full protos.
${BAZEL_BIN} test --sandbox_tmpfs_path=$TMP --strategy=TestRunner=standalone --test_output=all \
--define use_java_proto_full=true -- //tools/... -//objc/...
echo "bazel non objc-c passed" echo "bazel non objc-c passed"
...@@ -62,6 +62,62 @@ ...@@ -62,6 +62,62 @@
</testExcludes> </testExcludes>
</configuration> </configuration>
</plugin> </plugin>
<!-- generate and build lite protos -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<property
name="protoc.filename"
value="protoc-${protobuf.version}-${os.detected.classifier}.exe"/>
<property
name="protoc.filepath"
value="${project.build.directory}/${protoc.filename}"/>
<chmod file="${protoc.filepath}" perm="ugo+rx"/>
<property
name="protoc-plugin.filename"
value="protoc-gen-javalite-${protoc-gen-javalite.version}-${os.detected.classifier}.exe"/>
<property
name="protoc-plugin.filepath"
value="${project.build.directory}/${protoc-plugin.filename}"/>
<chmod file="${protoc-plugin.filepath}" perm="ugo+rx"/>
<mkdir dir="${protobuf.output.dir}" />
<path id="protobuf.input.filepaths.path">
<fileset dir="${tink.basedir}/proto">
<include name="**/*.proto"/>
</fileset>
</path>
<pathconvert
pathsep=" "
property="protobuf.input.filepaths"
refid="protobuf.input.filepaths.path"/>
<exec executable="${protoc.filepath}" failonerror="true">
<arg value="--proto_path=${tink.basedir}"/>
<arg value="--plugin=protoc-gen-javalite=${protoc-plugin.filepath}" />
<arg value="--javalite_out=${protobuf.output.dir}" />
<arg line="${protobuf.input.filepaths}"/>
</exec>
</target>
<sourceRoot>${protobuf.output.dir}</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
......
...@@ -298,62 +298,6 @@ ...@@ -298,62 +298,6 @@
</executions> </executions>
</plugin> </plugin>
<!-- generate and build lite protos -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<property
name="protoc.filename"
value="protoc-${protobuf.version}-${os.detected.classifier}.exe"/>
<property
name="protoc.filepath"
value="${project.build.directory}/${protoc.filename}"/>
<chmod file="${protoc.filepath}" perm="ugo+rx"/>
<property
name="protoc-plugin.filename"
value="protoc-gen-javalite-${protoc-gen-javalite.version}-${os.detected.classifier}.exe"/>
<property
name="protoc-plugin.filepath"
value="${project.build.directory}/${protoc-plugin.filename}"/>
<chmod file="${protoc-plugin.filepath}" perm="ugo+rx"/>
<mkdir dir="${protobuf.output.dir}" />
<path id="protobuf.input.filepaths.path">
<fileset dir="${tink.basedir}/proto">
<include name="**/*.proto"/>
</fileset>
</path>
<pathconvert
pathsep=" "
property="protobuf.input.filepaths"
refid="protobuf.input.filepaths.path"/>
<exec executable="${protoc.filepath}" failonerror="true">
<arg value="--proto_path=${tink.basedir}"/>
<arg value="--plugin=protoc-gen-javalite=${protoc-plugin.filepath}" />
<arg value="--javalite_out=${protobuf.output.dir}" />
<arg line="${protobuf.input.filepaths}"/>
</exec>
</target>
<sourceRoot>${protobuf.output.dir}</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Create javadoc.jar. --> <!-- Create javadoc.jar. -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
......
...@@ -106,4 +106,55 @@ ...@@ -106,4 +106,55 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<!-- generate and build full protos -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<property
name="protoc.filename"
value="protoc-${protobuf.version}-${os.detected.classifier}.exe"/>
<property
name="protoc.filepath"
value="${project.build.directory}/${protoc.filename}"/>
<chmod file="${protoc.filepath}" perm="ugo+rx"/>
<mkdir dir="${protobuf.output.dir}" />
<path id="protobuf.input.filepaths.path">
<fileset dir="${tink.basedir}/proto">
<include name="**/*.proto"/>
</fileset>
</path>
<pathconvert
pathsep=" "
property="protobuf.input.filepaths"
refid="protobuf.input.filepaths.path"/>
<exec executable="${protoc.filepath}" failonerror="true">
<arg value="--proto_path=${tink.basedir}"/>
<arg value="--java_out=${protobuf.output.dir}" />
<arg line="${protobuf.input.filepaths}"/>
</exec>
</target>
<sourceRoot>${protobuf.output.dir}</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment