aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Nicoara <ancr@google.com>2022-05-24 16:16:22 +0100
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2022-06-29 16:15:53 +0000
commit81c23549a5ce89c767a39807024b3e83d71de419 (patch)
tree52e0395da460fb3137c610aa71a2b125e23a9f4e
parent9a443c17c5f79ce9bf82ef62dd6bf6dfa14a2209 (diff)
downloadsoong-81c23549a5ce89c767a39807024b3e83d71de419.tar.gz
Passing the default apex version to the apexer
Test: presubmit Bug: 231691643 Change-Id: I900a6acde9f212bf785b0be35f422416c8b62792 (cherry picked from commit 3f8cbcb82cc9297488e0b95678550cbd960b1de4) Merged-In: I900a6acde9f212bf785b0be35f422416c8b62792
-rw-r--r--apex/Android.bp1
-rw-r--r--apex/builder.go2
-rw-r--r--apex/constants.go36
3 files changed, 39 insertions, 0 deletions
diff --git a/apex/Android.bp b/apex/Android.bp
index 41224ecd5..c4e64560e 100644
--- a/apex/Android.bp
+++ b/apex/Android.bp
@@ -24,6 +24,7 @@ bootstrap_go_package {
"apex.go",
"apex_singleton.go",
"builder.go",
+ "constants.go",
"deapexer.go",
"key.go",
"prebuilt.go",
diff --git a/apex/builder.go b/apex/builder.go
index a21fcb899..fc9bb3bec 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -655,6 +655,8 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
optFlags = append(optFlags, "--manifest_json "+a.manifestJsonOut.String())
}
+ optFlags = append(optFlags, "--apex_version "+defaultManifestVersion)
+
optFlags = append(optFlags, "--payload_fs_type "+a.payloadFsType.string())
ctx.Build(pctx, android.BuildParams{
diff --git a/apex/constants.go b/apex/constants.go
new file mode 100644
index 000000000..c68edb724
--- /dev/null
+++ b/apex/constants.go
@@ -0,0 +1,36 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// 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.
+
+package apex
+
+// This file contains branch specific constants. They are stored in a separate
+// file to minimise the potential of merge conflicts between branches when
+// the code from the package is changed.
+
+// The default manifest version for all the modules on this branch.
+// This version code will be used only if there is no version field in the
+// module's apex_manifest.json. Release branches have their version injected
+// into apex_manifest.json by the tooling and will not use the version set
+// here. Developers can also set the version field locally in the
+// apex_manifest.json to build a module with a specific version.
+//
+// The value follows the schema from go/mainline-version-codes, and is chosen
+// based on the branch such that the builds from testing and development
+// branches will have a version higher than the prebuilts.
+// Versions per branch:
+// * x-dev - xx0090000 (where xx is the branch SDK level)
+// * AOSP - xx9990000
+// * x-mainline-prod - xx9990000
+// * master - 990090000
+const defaultManifestVersion = "339990000"