diff --git a/BUILD.dist b/BUILD.dist new file mode 100644 index 0000000000..4ab04c6f9d --- /dev/null +++ b/BUILD.dist @@ -0,0 +1,59 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache License 2.0 + +exports_files(["LICENSE"]) + +package( + default_visibility = ["//visibility:public"], +) + +genrule( + name = "jre_emul_jar", + srcs = ["lib/jre_emul.jar"], + outs = ["jre_emul.jar"], + cmd = "cp $< $@", +) + +java_import( + name = "annotations", + jars = ["lib/j2objc_annotations.jar"], +) + +java_import( + name = "j2objc", + jars = ["lib/j2objc.jar"], + exports = [":annotations"], +) + +objc_import( + name = "jre_core_lib", + hdrs = glob(["include/**"]), + includes = ["include"], + archives = ["lib/libjre_core.a"], + sdk_dylibs = [ + "libiconv", + ], +) + +filegroup( + name = "proto_plugin", + srcs = ["j2objc_protoc_plugin"] +) + +objc_import( + name = "proto_runtime", + hdrs = glob(["include/**"]), + includes = ["include"], + archives = ["lib/libprotobuf_runtime.a"], +) diff --git a/Makefile b/Makefile index c28df1944b..ae86f2cf68 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,19 @@ install-man-pages: $(MAN_PAGES) @mkdir -p $(DIST_DIR)/man/man1 @install -C -m 0644 $? $(DIST_DIR)/man/man1 +EXTRA_DIST_FILES = LICENSE WORKSPACE BUILD + +$(DIST_DIR)/%: %.dist + @mkdir -p $(@D) + @install -C -m 644 $< $@ + +$(DIST_DIR)/%: % + @mkdir -p $(@D) + @install -C -m 644 $< $@ + +install-extras: $(EXTRA_DIST_FILES:%=$(DIST_DIR)/%) + @: + frameworks: dist @cd jre_emul && $(MAKE) framework @cd junit && $(MAKE) framework @@ -53,7 +66,7 @@ all_frameworks: frameworks protobuf_dist dist: print_environment translator_dist jre_emul_dist junit_dist jsr305_dist \ javax_inject_dist guava_dist mockito_dist cycle_finder_dist \ - xalan_dist install-man-pages + xalan_dist install-man-pages install-extras protobuf_dist: protobuf_compiler_dist protobuf_runtime_dist diff --git a/WORKSPACE.dist b/WORKSPACE.dist new file mode 100644 index 0000000000..d020fbcc0c --- /dev/null +++ b/WORKSPACE.dist @@ -0,0 +1,14 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The presence of thie WORKSPACE file in the J2ObjC distribution makes it +# accessible as a Bazel repository. diff --git a/make/common.mk b/make/common.mk index 266da88f55..cf588dc9fd 100644 --- a/make/common.mk +++ b/make/common.mk @@ -8,7 +8,7 @@ DIST_DIR = $(J2OBJC_ROOT)/dist DIST_INCLUDE_DIR = $(DIST_DIR)/include DIST_LIB_DIR = $(DIST_DIR)/lib DIST_JAR_DIR = $(DIST_LIB_DIR) -DIST_LICENSE_DIR = $(DIST_DIR)/license +DIST_LICENSE_DIR = $(DIST_DIR)/licenses DIST_FRAMEWORK_DIR = $(DIST_DIR)/frameworks # Release version string used by j2objc and cycle_finder's -version flag.