forked from bazel-contrib/rules_jvm_external
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from vinnybod/classifier-pom-followup
DP-14758 - pom file follow up
- Loading branch information
Showing
16 changed files
with
218 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | ||
load("//:defs.bzl", "artifact", "java_export", "maven_bom") | ||
|
||
java_export( | ||
name = "pom-example", | ||
srcs = ["PomExample.java"], | ||
maven_coordinates = "com.example:app:1.0.0", | ||
deps = [ | ||
"//tests/integration/maven_bom:one-dep", | ||
], | ||
) | ||
|
||
diff_test( | ||
name = "validate-pom", | ||
file1 = ":pom-example-pom", | ||
file2 = "pom.golden.xml", | ||
) | ||
|
||
java_export( | ||
name = "pom-example-with-runtime-dep", | ||
srcs = ["PomExample.java"], | ||
maven_coordinates = "com.example:app:1.0.0", | ||
runtime_deps = [ | ||
"//tests/integration/maven_bom:one-dep", | ||
], | ||
deps = [ | ||
"//tests/integration/maven_bom:one-dep", | ||
artifact("com.google.guava:guava"), | ||
], | ||
) | ||
|
||
diff_test( | ||
name = "validate-pom-with-runtime-dep", | ||
file1 = ":pom-example-with-runtime-dep-pom", | ||
file2 = "pom-with-runtime-dep.golden.xml", | ||
) | ||
|
||
java_export( | ||
name = "pom-example-with-classifier-dep", | ||
srcs = ["PomExample.java"], | ||
maven_coordinates = "com.example:app:1.0.0", | ||
runtime_deps = [ | ||
":classifier-artifact-one", | ||
], | ||
deps = [ | ||
":classifier-artifact-one", | ||
":classifier-artifact-two", | ||
], | ||
) | ||
|
||
java_export( | ||
name = "classifier-artifact-one", | ||
srcs = ["ClassifierArtifactOne.java"], | ||
maven_coordinates = "com.example:lib:jar:linux-x86:1.0.0", | ||
) | ||
|
||
java_export( | ||
name = "classifier-artifact-two", | ||
srcs = ["ClassifierArtifactTwo.java"], | ||
maven_coordinates = "com.example:lib:jar:linux-arm64:1.0.0", | ||
) | ||
|
||
diff_test( | ||
name = "validate-pom-example-with-classifier-dep", | ||
file1 = ":pom-example-with-classifier-dep-pom", | ||
file2 = "pom-with-classifier-dep.golden.xml", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tests.integration.pom_file; | ||
|
||
public class ClassifierArtifactOne { | ||
// This space left blank intentionally | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package tests.integration.pom_file; | ||
|
||
public class ClassifierArtifactTwo { | ||
// This space left blank intentionally | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package tests.integration.pom_file; | ||
|
||
public class PomExample { | ||
|
||
public static void main(String[] args) { | ||
System.out.println("Hello World!"); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
tests/integration/pom_file/pom-with-classifier-dep.golden.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>app</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.example</groupId> | ||
<artifactId>lib</artifactId> | ||
<version>1.0.0</version> | ||
<scope>runtime</scope> | ||
<classifier>linux-x86</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.example</groupId> | ||
<artifactId>lib</artifactId> | ||
<version>1.0.0</version> | ||
<classifier>linux-arm64</classifier> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.