Skip to content
Permalink
Browse files

[Java][Bazel] Refine auto-generated pom files (#4780)

  • Loading branch information...
raulchen committed May 16, 2019
1 parent cb1a195 commit 643f62dc43929ace27789f1634d49a26e888c340
@@ -53,12 +53,13 @@ def define_java_module(name, additional_srcs = [], additional_resources = [], de
size = "small",
tags = ["checkstyle"],
)

def gen_java_pom_file(name):
pom_file(
name = "org_ray_ray_" + name + "_pom",
targets = [
":org_ray_ray_" + name,
],
template_file = name + "/pom_template.xml",
substitutions = {
"{auto_gen_header}": "<!-- This file is auto-generated by Bazel from pom_template.xml, do not modify it. -->",
},
)
@@ -1,4 +1,4 @@
load("//bazel:ray.bzl", "flatbuffer_java_library", "define_java_module", "gen_java_pom_file")
load("//bazel:ray.bzl", "flatbuffer_java_library", "define_java_module")

exports_files([
"testng.xml",
@@ -7,27 +7,29 @@ exports_files([
"streaming/testng.xml",
])

all_modules = [
"api",
"runtime",
"test",
"tutorial",
"streaming",
]

java_import(
name = "all_modules",
jars = [
"liborg_ray_ray_api.jar",
"liborg_ray_ray_api-src.jar",
"liborg_ray_ray_runtime.jar",
"liborg_ray_ray_runtime-src.jar",
"liborg_ray_ray_tutorial.jar",
"liborg_ray_ray_tutorial-src.jar",
"liborg_ray_ray_streaming.jar",
"liborg_ray_ray_streaming-src.jar",
"liborg_ray_ray_" + module + ".jar" for module in all_modules
] + [
"liborg_ray_ray_" + module + "-src.jar" for module in all_modules
] + [
"all_tests_deploy.jar",
"all_tests_deploy-src.jar",
"streaming_tests_deploy.jar",
"streaming_tests_deploy-src.jar",
],
deps = [
":org_ray_ray_api",
":org_ray_ray_runtime",
":org_ray_ray_tutorial",
":org_ray_ray_streaming",
":org_ray_ray_" + module for module in all_modules
] + [
":all_tests",
":streaming_tests",
],
@@ -247,30 +249,10 @@ genrule(
local = 1,
)

# generate pom.xml file for maven compile
gen_java_pom_file(
name = "api",
)

gen_java_pom_file(
name = "runtime",
)

gen_java_pom_file(
name = "tutorial",
)

gen_java_pom_file(
name = "test",
)

genrule(
name = "copy_pom_file",
srcs = [
"//java:org_ray_ray_api_pom",
"//java:org_ray_ray_runtime_pom",
"//java:org_ray_ray_tutorial_pom",
"//java:org_ray_ray_test_pom",
"//java:org_ray_ray_" + module + "_pom" for module in all_modules
],
outs = ["copy_pom_file.out"],
cmd = """
@@ -280,6 +262,7 @@ genrule(
cp -f $(location //java:org_ray_ray_runtime_pom) $$WORK_DIR/java/runtime/pom.xml
cp -f $(location //java:org_ray_ray_tutorial_pom) $$WORK_DIR/java/tutorial/pom.xml
cp -f $(location //java:org_ray_ray_test_pom) $$WORK_DIR/java/test/pom.xml
cp -f $(location //java:org_ray_ray_streaming_pom) $$WORK_DIR/java/streaming/pom.xml
echo $$(date) > $@
""",
local = 1,
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is auto-generated by Bazel from pom_template.xml, do not modify it. -->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,21 +17,30 @@
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
</dependencies>
</project>
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
{auto_gen_header}
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -16,6 +17,6 @@
<packaging>jar</packaging>

<dependencies>
{generated_bzl_deps}
{generated_bzl_deps}
</dependencies>
</project>
@@ -20,8 +20,6 @@
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<projetct.version>0.1-SNAPSHOT</projetct.version>
<slf4j.version>1.7.25</slf4j.version>
<jaxb.version>2.3.0</jaxb.version>
</properties>

<dependencyManagement>
@@ -31,76 +29,6 @@
<artifactId>arrow-plasma</artifactId>
<version>0.13.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>2.47</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>1.9.0.1</version>
</dependency>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.72</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.9</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is auto-generated by Bazel from pom_template.xml, do not modify it. -->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -21,53 +22,60 @@
<artifactId>ray-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
</dependency>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>flatbuffers-java</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-plasma</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>1.9.0.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0.1-jre</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>2.47</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.0</version>
</dependency>
</dependencies>

<build>
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
{auto_gen_header}
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -25,7 +26,7 @@
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-plasma</artifactId>
</dependency>
{generated_bzl_deps}
{generated_bzl_deps}
</dependencies>

<build>

0 comments on commit 643f62d

Please sign in to comment.
You can’t perform that action at this time.