-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gazelle): add kotlin support for rules_jvm_external maven_instal…
…l deps (#2998) GitOrigin-RevId: ed09073be587906135e32de4089a9c75ae1d45de
- Loading branch information
Showing
22 changed files
with
587 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package gazelle | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func assertTrue(t *testing.T, b bool, msg string) { | ||
if !b { | ||
t.Error(msg) | ||
} | ||
} | ||
|
||
func TestKotlinNative(t *testing.T) { | ||
t.Run("kotlin native libraries", func(t *testing.T) { | ||
assertTrue(t, IsNativeImport("kotlin.io"), "kotlin.io should be native") | ||
assertTrue(t, IsNativeImport("kotlinx.foo"), "kotlinx.* should be native") | ||
}) | ||
|
||
t.Run("java native libraries", func(t *testing.T) { | ||
assertTrue(t, IsNativeImport("java.foo"), "java.* should be native") | ||
assertTrue(t, IsNativeImport("javax.accessibility"), "javax should be native") | ||
assertTrue(t, IsNativeImport("javax.net"), "javax should be native") | ||
assertTrue(t, IsNativeImport("javax.sql"), "javax should be native") | ||
assertTrue(t, IsNativeImport("javax.xml"), "javax should be native") | ||
assertTrue(t, IsNativeImport("org.xml.sax"), "org.xml.sax should be native") | ||
}) | ||
} |
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 @@ | ||
# TODO(gazelle:)java_maven_repository_name vendor_java |
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 @@ | ||
# TODO(gazelle:)java_maven_repository_name vendor_java |
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,8 @@ | ||
Copied from | ||
[rules_jvm "maven" test](https://github.com/bazel-contrib/rules_jvm/tree/v0.17.0/java/gazelle/testdata/maven). | ||
|
||
Created by ~ following steps: | ||
|
||
1. Copy the rules_jvm "maven" test | ||
2. Rename .java to .kt | ||
3. Modify .kt files to Kotlin syntax with a minimal diff |
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,27 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "rules_jvm_external", | ||
sha256 = "23fe83890a77ac1a3ee143e2306ec12da4a845285b14ea13cb0df1b1e23658fe", | ||
strip_prefix = "rules_jvm_external-4.3", | ||
urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.3.tar.gz"], | ||
) | ||
|
||
load("@rules_jvm_external//:defs.bzl", "maven_install") | ||
|
||
maven_install( | ||
artifacts = [ | ||
"junit:junit:4.13.1", | ||
"com.google.guava:guava:30.0-jre", | ||
], | ||
fetch_sources = True, | ||
maven_install_json = "//:maven_install.json", | ||
repositories = [ | ||
"http://uk.maven.org/maven2", | ||
"https://jcenter.bintray.com/", | ||
], | ||
) | ||
|
||
load("@maven//:defs.bzl", "pinned_maven_install") | ||
|
||
pinned_maven_install() |
Oops, something went wrong.