-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] Expand Java GN rules to support more complex usecases (#9876)
* Amend Java build rules to support prebuilt JARs and using Java targets in deps. * Test Java GN build rules
- Loading branch information
Showing
25 changed files
with
594 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/pigweed.gni") | ||
import("$dir_pw_build/python.gni") | ||
import("${chip_root}/build/chip/java/rules.gni") | ||
|
||
pw_python_script("java_build_test") { | ||
inputs = [ | ||
"expected_output/child_library_2_expected.json", | ||
"expected_output/grandchild_library_expected.json", | ||
"expected_output/child_library_expected.json", | ||
"expected_output/java_library_expected.json", | ||
"expected_output/child_prebuilt_expected.json", | ||
"expected_output/java_prebuilt_expected.json", | ||
] | ||
other_deps = [ ":java_library" ] | ||
tests = [ "test.py" ] | ||
} | ||
|
||
java_library("java_library") { | ||
sources = [ "IncludedInSources.java" ] | ||
deps = [ | ||
":child_library", | ||
":child_library_2", | ||
":java_prebuilt", | ||
] | ||
} | ||
|
||
java_library("child_library") { | ||
sources = [ "IncludedInChildSources.java" ] | ||
} | ||
|
||
java_library("child_library_2") { | ||
sources = [ "IncludedInChildSources2.java" ] | ||
|
||
deps = [ ":grandchild_library" ] | ||
} | ||
|
||
java_library("grandchild_library") { | ||
sources = [ "IncludedInGrandchildSources.java" ] | ||
} | ||
|
||
java_prebuilt("java_prebuilt") { | ||
jar_path = "/tmp/chip_java_build_test/prebuilt_jar.jar" | ||
deps = [ ":child_prebuilt" ] | ||
} | ||
|
||
java_prebuilt("child_prebuilt") { | ||
jar_path = "/tmp/chip_java_build_test/child_jar.jar" | ||
} |
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,3 @@ | ||
package build.chip.java.tests; | ||
|
||
public class IncludedInChildJar {} |
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,3 @@ | ||
package build.chip.java.tests; | ||
|
||
public class IncludedInChildSources {} |
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 build.chip.java.tests; | ||
|
||
public class IncludedInChildSources2 { | ||
IncludedInGrandchildSources includedInGrandchildSources; | ||
} |
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,3 @@ | ||
package build.chip.java.tests; | ||
|
||
public class IncludedInGrandchildSources {} |
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 build.chip.java.tests; | ||
|
||
public class IncludedInJar { | ||
IncludedInChildJar includedInChildJar; | ||
} |
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 build.chip.java.tests; | ||
|
||
public class IncludedInSources { | ||
IncludedInChildSources includedInChildSources; | ||
IncludedInChildSources2 includedInChildSources2; | ||
IncludedInGrandchildSources includedInGrandchildSources; | ||
|
||
IncludedInJar includedInJar; | ||
} |
Oops, something went wrong.