Skip to content

Commit

Permalink
Move //gn/* to //* (project-chip#3070)
Browse files Browse the repository at this point in the history
* Move //gn/* to //*

This avoids needing to use the secondary_source path remapping which can
cause confusion as the contents of //gn are all named without saying
"//gn".

By convention, the build system shared files are placed at //build and
non-shares files are //build_overrides. This allows drop the CHIP build
into other projects as a submodule, as long as they follow the same
conventions.

* Fix labeler
  • Loading branch information
mspang authored Oct 7, 2020
1 parent 1758d43 commit 55d6a5f
Show file tree
Hide file tree
Showing 114 changed files with 81 additions and 100 deletions.
5 changes: 3 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ vscode:
- .devcontainer

gn:
- gn/*
- .gn/*
- build/*
- build_overrides/*
- .gn
- "*.gn"
- "*.gni"

Expand Down
5 changes: 1 addition & 4 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//gn/"

import("//gn/build_overrides/pigweed.gni")
import("//build_overrides/pigweed.gni")

script_executable = "python3"

Expand Down
6 changes: 3 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import("//build_overrides/pigweed.gni")
# This build file should not be used in superproject builds.
assert(chip_root == "//")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/gn/chip/tools.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/build/chip/tools.gni")

if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
declare_args() {
Expand Down Expand Up @@ -91,7 +91,7 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
}
} else {
# This is the unified build. Configure various real toolchains.
import("${chip_root}/gn/chip/chip_build.gni")
import("${chip_root}/build/chip/chip_build.gni")
declare_args() {
# Set this to false to disable all builds by default.
enable_default_builds = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ template("buildconfig_header") {
gen_target_name = "gen_${target_name}"

action(gen_target_name) {
script = "${chip_root}/gn/chip/write_buildconfig_header.py"
script = "${chip_root}/build/chip/write_buildconfig_header.py"

if (defined(invoker.header_dir)) {
header_file = "${invoker.header_dir}/${invoker.header}"
Expand Down
2 changes: 1 addition & 1 deletion gn/chip/chip_build.gni → build/chip/chip_build.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/tests.gni")

template("chip_build") {
_build_name = target_name
Expand Down
2 changes: 1 addition & 1 deletion gn/chip/chip_test.gni → build/chip/chip_test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/platform/device.gni")
import("${dir_pw_unit_test}/test.gni")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/tests.gni")

assert(chip_build_tests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/chip_test.gni")
import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/chip_test.gni")
import("${chip_root}/build/chip/tests.gni")
import("${dir_pw_unit_test}/test.gni")

assert(chip_build_tests)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions gn/chip/java/rules.gni → build/chip/java/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")

import("//build/config/android/config.gni")

javac_runner = "//gn/chip/java/javac_runner.py"
jar_runner = "//gn/chip/java/jar_runner.py"
javac_runner = "${chip_root}/build/chip/java/javac_runner.py"
jar_runner = "${chip_root}/build/chip/java/jar_runner.py"

assert(android_sdk_root != "", "android_sdk_root must be specified")

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ template("objcopy_convert") {
rebase_path(conversion_input, root_build_dir),
rebase_path(conversion_output, root_build_dir),
]
script = "${chip_root}/gn/build/gn_run_binary.py"
script = "//build/gn_run_binary.py"
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions config/esp32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "esp32"
target_os = "freertos"
Expand Down
2 changes: 1 addition & 1 deletion config/esp32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/tests.gni")

group("esp32") {
deps = [ "${chip_root}/src/lib" ]
Expand Down
1 change: 1 addition & 0 deletions config/esp32/build
3 changes: 0 additions & 3 deletions config/nrfconnect/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "zephyr"
Expand Down
2 changes: 1 addition & 1 deletion config/nrfconnect/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("//${chip_root}/gn/chip/tests.gni")
import("//${chip_root}/build/chip/tests.gni")

assert(current_os == "zephyr")

Expand Down
1 change: 1 addition & 0 deletions config/nrfconnect/build
3 changes: 0 additions & 3 deletions examples/chip-tool/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
import("//args.gni")
}
2 changes: 1 addition & 1 deletion examples/chip-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tools.gni")
import("${chip_root}/build/chip/tools.gni")

assert(chip_build_tools)

Expand Down
1 change: 1 addition & 0 deletions examples/chip-tool/build
3 changes: 0 additions & 3 deletions examples/common/chip-app-server/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
import("//args.gni")
}
1 change: 1 addition & 0 deletions examples/common/chip-app-server/build
3 changes: 0 additions & 3 deletions examples/lighting-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/efr32/build
3 changes: 0 additions & 3 deletions examples/lighting-app/linux/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
import("//args.gni")
}
2 changes: 1 addition & 1 deletion examples/lighting-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tools.gni")
import("${chip_root}/build/chip/tools.gni")

assert(chip_build_tools)

Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/linux/build
3 changes: 0 additions & 3 deletions examples/lighting-app/nrf5/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nrf5/build
3 changes: 0 additions & 3 deletions examples/lock-app/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/efr32/build
3 changes: 0 additions & 3 deletions examples/lock-app/nrf5/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/nrf5/build
3 changes: 0 additions & 3 deletions examples/lock-app/qpg6100/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/qpg6100/build
3 changes: 0 additions & 3 deletions examples/pigweed-app/nrf5/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
target_cpu = "arm"
target_os = "freertos"
Expand Down
1 change: 1 addition & 0 deletions examples/pigweed-app/nrf5/build
3 changes: 0 additions & 3 deletions examples/shell/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ buildconfig = "//build/config/BUILDCONFIG.gn"
# CHIP uses angle bracket includes.
check_system_includes = true

# Allow loading paths relative to //gn.
secondary_source = "//third_party/connectedhomeip/gn/"

default_args = {
chip_build_tests = false
}
2 changes: 1 addition & 1 deletion examples/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if (chip_device_platform == "nrf5") {
deps = [ ":nrf5" ]
}
} else {
import("${chip_root}/gn/chip/tools.gni")
import("${chip_root}/build/chip/tools.gni")

assert(chip_build_tools)

Expand Down
1 change: 1 addition & 0 deletions examples/shell/build
4 changes: 2 additions & 2 deletions src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/lwip/lwip.gni")
import("${chip_root}/src/platform/device.gni")

Expand All @@ -33,7 +33,7 @@ config("includes") {
}

if (chip_build_tests) {
import("${chip_root}/gn/chip/chip_test_group.gni")
import("${chip_root}/build/chip/chip_test_group.gni")

chip_test_group("tests") {
deps = [
Expand Down
4 changes: 2 additions & 2 deletions src/ble/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import("//build_overrides/chip.gni")

import("${chip_root}/gn/chip/buildconfig_header.gni")
import("${chip_root}/gn/chip/tests.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/platform/device.gni")
import("ble.gni")

Expand Down
2 changes: 1 addition & 1 deletion src/ble/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import("//build_overrides/chip.gni")
import("//build_overrides/nlunit_test.gni")

import("${chip_root}/gn/chip/chip_test_suite.gni")
import("${chip_root}/build/chip/chip_test_suite.gni")

chip_test_suite("tests") {
output_name = "libBleLayerTests"
Expand Down
5 changes: 3 additions & 2 deletions src/controller/java/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("//gn/build/config/android_abi.gni")
import("//gn/chip/java/rules.gni")

import("//build/config/android_abi.gni")
import("${chip_root}/build/chip/java/rules.gni")

shared_library("jni") {
output_name = "libCHIPController"
Expand Down
7 changes: 5 additions & 2 deletions src/controller/python/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/gn/chip/tools.gni")
import("${chip_root}/build/chip/tools.gni")
import("${dir_pw_unit_test}/test.gni")

config("controller_wno_deprecate") {
Expand Down Expand Up @@ -118,7 +118,10 @@ pw_python_script("python") {

public_deps = [ ":ChipDeviceCtrl" ]

pythontags = exec_script("//chip/python_gen_tags.py", [], "list lines", [])
pythontags = exec_script("${chip_root}/build/chip/python_gen_tags.py",
[],
"list lines",
[])
pythontagsStr = string_join("", pythontags)
output_name = "chip-0.0-$pythontagsStr.whl"
outputs = [ "${_dist_dir}/$output_name" ]
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import("//build_overrides/chip.gni")
import("//build_overrides/nlassert.gni")

import("${chip_root}/gn/chip/buildconfig_header.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")

import("crypto.gni")

Expand Down
Loading

0 comments on commit 55d6a5f

Please sign in to comment.