diff options
author | 2019-10-11 14:59:13 +0900 | |
---|---|---|
committer | 2019-10-15 18:49:58 +0900 | |
commit | 9b409bcd10cec5c64b12494a6ada05a7dd65a721 (patch) | |
tree | d4234a2da8f8dd99ecc186e872d637c45bd11330 /sdk/sdk_test.go | |
parent | 8785e55e1c9d7d5f9659afd88cba940108202aaf (diff) |
Create scripts to update and freeze a module SDK
`m <sdk_name>` generates two scripts each of which is use to update the
current snapshot of the SDK and to freeze ToT as a new version,
respectively. Executing the scripts will copy necessary files (stub
libraries, AIDL files, etc.) along with Android.bp into the ./<apiver>
directory under the directory where the sdk is defined.
This change also introduces a new module type 'sdk_snapshot' that
represents a snapshot of an SDK. It will be auto-generated by the above
scripts, so developers are not expected to write this manually.
The module type 'sdk' is now used to simply specify the list of modules
that an SDK has.
Finally, this change changes the version separator from '#' to '@'
because '#' confuses Make.
Bug: 138182343
Test: m
Change-Id: Ifcbc3a39a2f6ad5b4f4b200ba55a1ce3281498cf
Diffstat (limited to 'sdk/sdk_test.go')
-rw-r--r-- | sdk/sdk_test.go | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go index 9eca72fdc..942556a32 100644 --- a/sdk/sdk_test.go +++ b/sdk/sdk_test.go @@ -69,6 +69,7 @@ func testSdkContext(t *testing.T, bp string) (*android.TestContext, android.Conf // from this package ctx.RegisterModuleType("sdk", android.ModuleFactoryAdaptor(ModuleFactory)) + ctx.RegisterModuleType("sdk_snapshot", android.ModuleFactoryAdaptor(SnapshotModuleFactory)) ctx.PreDepsMutators(RegisterPreDepsMutators) ctx.PostDepsMutators(RegisterPostDepsMutators) @@ -155,12 +156,17 @@ func pathsToStrings(paths android.Paths) []string { func TestBasicSdkWithJava(t *testing.T) { ctx, _ := testSdk(t, ` sdk { - name: "mysdk#1", + name: "mysdk", + java_libs: ["sdkmember"], + } + + sdk_snapshot { + name: "mysdk@1", java_libs: ["sdkmember_mysdk_1"], } - sdk { - name: "mysdk#2", + sdk_snapshot { + name: "mysdk@2", java_libs: ["sdkmember_mysdk_2"], } @@ -195,7 +201,7 @@ func TestBasicSdkWithJava(t *testing.T) { apex { name: "myapex", java_libs: ["myjavalib"], - uses_sdks: ["mysdk#1"], + uses_sdks: ["mysdk@1"], key: "myapex.key", certificate: ":myapex.cert", } @@ -203,7 +209,7 @@ func TestBasicSdkWithJava(t *testing.T) { apex { name: "myapex2", java_libs: ["myjavalib"], - uses_sdks: ["mysdk#2"], + uses_sdks: ["mysdk@2"], key: "myapex.key", certificate: ":myapex.cert", } @@ -223,12 +229,17 @@ func TestBasicSdkWithJava(t *testing.T) { func TestBasicSdkWithCc(t *testing.T) { ctx, _ := testSdk(t, ` sdk { - name: "mysdk#1", + name: "mysdk", + native_shared_libs: ["sdkmember"], + } + + sdk_snapshot { + name: "mysdk@1", native_shared_libs: ["sdkmember_mysdk_1"], } - sdk { - name: "mysdk#2", + sdk_snapshot { + name: "mysdk@2", native_shared_libs: ["sdkmember_mysdk_2"], } @@ -267,7 +278,7 @@ func TestBasicSdkWithCc(t *testing.T) { apex { name: "myapex", native_shared_libs: ["mycpplib"], - uses_sdks: ["mysdk#1"], + uses_sdks: ["mysdk@1"], key: "myapex.key", certificate: ":myapex.cert", } @@ -275,7 +286,7 @@ func TestBasicSdkWithCc(t *testing.T) { apex { name: "myapex2", native_shared_libs: ["mycpplib"], - uses_sdks: ["mysdk#2"], + uses_sdks: ["mysdk@2"], key: "myapex.key", certificate: ":myapex.cert", } |