From ce23942f3c485232d49a8ed06ba0c443a2568a9d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 8 Nov 2019 14:17:49 -0800 Subject: [PATCH] Move partner androidmk and bpfix files to match their package path Using a gomod-aware editor with build/soong requires that files in build/soong can be mapped to the android/soong package path. Move the partner androidmk and bpfix files such that their path matches the package path when the android/soong package prefix is replaced with the build/soong path prefix. Test: go test ./... Test: m bpfix androidmk partner_bpfix partner_androidmk Change-Id: Ic7f7aad9e5eb9178eef0383f0b37e4fb93ce8314 --- bpfix/Android.bp | 4 ++-- bpfix/cmd/main.go | 6 ++---- bpfix/{cmd-lib => cmd_lib}/bpfix.go | 2 +- .../partner_androidmk => partner}/Android.bp | 18 +++++++++--------- .../androidmk}/androidmk.go | 2 +- .../androidmk}/androidmk_test.go | 2 +- .../partner_bpfix => partner/bpfix}/bpfix.go | 6 +++--- .../bpfix/extensions}/headers.go | 0 8 files changed, 19 insertions(+), 21 deletions(-) rename bpfix/{cmd-lib => cmd_lib}/bpfix.go (99%) rename {androidmk/partner_androidmk => partner}/Android.bp (71%) rename {androidmk/partner_androidmk/partner_androidmk => partner/androidmk}/androidmk.go (96%) rename {androidmk/partner_androidmk/partner_androidmk => partner/androidmk}/androidmk_test.go (97%) rename {androidmk/partner_androidmk/partner_bpfix => partner/bpfix}/bpfix.go (88%) rename {androidmk/partner_androidmk/fixes => partner/bpfix/extensions}/headers.go (100%) diff --git a/bpfix/Android.bp b/bpfix/Android.bp index aec9ff9c1..e29157849 100644 --- a/bpfix/Android.bp +++ b/bpfix/Android.bp @@ -28,9 +28,9 @@ blueprint_go_binary { bootstrap_go_package { name: "bpfix-cmd", - pkgPath: "android/soong/bpfix/bpfix/cmd", + pkgPath: "android/soong/bpfix/cmd_lib", srcs: [ - "cmd-lib/bpfix.go", + "cmd_lib/bpfix.go", ], deps: [ "bpfix-lib", diff --git a/bpfix/cmd/main.go b/bpfix/cmd/main.go index 8ca16b48f..ad6814493 100644 --- a/bpfix/cmd/main.go +++ b/bpfix/cmd/main.go @@ -16,10 +16,8 @@ package main -import ( - "android/soong/bpfix/bpfix/cmd" -) +import "android/soong/bpfix/cmd_lib" func main() { - cmd.Run() + cmd_lib.Run() } diff --git a/bpfix/cmd-lib/bpfix.go b/bpfix/cmd_lib/bpfix.go similarity index 99% rename from bpfix/cmd-lib/bpfix.go rename to bpfix/cmd_lib/bpfix.go index 98122f213..f90f65be6 100644 --- a/bpfix/cmd-lib/bpfix.go +++ b/bpfix/cmd_lib/bpfix.go @@ -16,7 +16,7 @@ // TODO(jeffrygaston) should this file be consolidated with bpfmt.go? -package cmd +package cmd_lib import ( "bytes" diff --git a/androidmk/partner_androidmk/Android.bp b/partner/Android.bp similarity index 71% rename from androidmk/partner_androidmk/Android.bp rename to partner/Android.bp index 532116af8..f2ced8dd3 100644 --- a/androidmk/partner_androidmk/Android.bp +++ b/partner/Android.bp @@ -1,4 +1,4 @@ -// Copyright 2015 Google Inc. All rights reserved. +// Copyright 2019 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,31 +19,31 @@ blueprint_go_binary { name: "partner_androidmk", srcs: [ - "partner_androidmk/androidmk.go", + "androidmk/androidmk.go", ], testSrcs: [ - "partner_androidmk/androidmk_test.go", + "androidmk/androidmk_test.go", ], deps: [ "androidmk-lib", - "partner_bpfix_extensions", + "partner-bpfix-extensions", ], } blueprint_go_binary { name: "partner_bpfix", srcs: [ - "partner_bpfix/bpfix.go", + "bpfix/bpfix.go", ], deps: [ "bpfix-cmd", - "partner_bpfix_extensions", + "partner-bpfix-extensions", ], } bootstrap_go_package { - name: "partner_bpfix_extensions", - pkgPath: "partner/android/bpfix/extensions", - srcs: ["fixes/headers.go"], + name: "partner-bpfix-extensions", + pkgPath: "android/soong/partner/bpfix/extensions", + srcs: ["bpfix/extensions/headers.go"], deps: ["bpfix-lib"], } diff --git a/androidmk/partner_androidmk/partner_androidmk/androidmk.go b/partner/androidmk/androidmk.go similarity index 96% rename from androidmk/partner_androidmk/partner_androidmk/androidmk.go rename to partner/androidmk/androidmk.go index af8cdf352..f49981b09 100644 --- a/androidmk/partner_androidmk/partner_androidmk/androidmk.go +++ b/partner/androidmk/androidmk.go @@ -23,7 +23,7 @@ import ( "android/soong/androidmk/androidmk" - _ "partner/android/bpfix/extensions" + _ "android/soong/partner/bpfix/extensions" ) var usage = func() { diff --git a/androidmk/partner_androidmk/partner_androidmk/androidmk_test.go b/partner/androidmk/androidmk_test.go similarity index 97% rename from androidmk/partner_androidmk/partner_androidmk/androidmk_test.go rename to partner/androidmk/androidmk_test.go index ff04e886c..6bae836d9 100644 --- a/androidmk/partner_androidmk/partner_androidmk/androidmk_test.go +++ b/partner/androidmk/androidmk_test.go @@ -23,7 +23,7 @@ import ( "android/soong/androidmk/androidmk" "android/soong/bpfix/bpfix" - _ "partner/android/bpfix/extensions" + _ "android/soong/partner/bpfix/extensions" ) var testCases = []struct { diff --git a/androidmk/partner_androidmk/partner_bpfix/bpfix.go b/partner/bpfix/bpfix.go similarity index 88% rename from androidmk/partner_androidmk/partner_bpfix/bpfix.go rename to partner/bpfix/bpfix.go index 2c8e0a81f..687fe1c04 100644 --- a/androidmk/partner_androidmk/partner_bpfix/bpfix.go +++ b/partner/bpfix/bpfix.go @@ -17,11 +17,11 @@ package main import ( - "android/soong/bpfix/bpfix/cmd" + "android/soong/bpfix/cmd_lib" - _ "partner/android/bpfix/extensions" + _ "android/soong/partner/bpfix/extensions" ) func main() { - cmd.Run() + cmd_lib.Run() } diff --git a/androidmk/partner_androidmk/fixes/headers.go b/partner/bpfix/extensions/headers.go similarity index 100% rename from androidmk/partner_androidmk/fixes/headers.go rename to partner/bpfix/extensions/headers.go