Skip to content

Commit

Permalink
Adds a WORKSPACE and BUILD file to our distribution for Bazel support.
Browse files Browse the repository at this point in the history
Adds our LICENSE file to our distribution.

	Change on 2017/07/21 by kstanger <kstanger@google.com>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162753939
  • Loading branch information
kstanger committed Aug 16, 2017
1 parent 903d3e5 commit cec37ac
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 2 deletions.
59 changes: 59 additions & 0 deletions BUILD.dist
Original file line number Diff line number Diff line change
@@ -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"],
)
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
14 changes: 14 additions & 0 deletions WORKSPACE.dist
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cec37ac

Please sign in to comment.