Skip to content

Commit

Permalink
Introduce sub-module builds
Browse files Browse the repository at this point in the history
  • Loading branch information
amitnj committed Apr 26, 2022
1 parent c5826df commit 07400b6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 18 deletions.
39 changes: 29 additions & 10 deletions scripts/build/builders/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def ExampleName(self):
else:
return None

def Modules(self):
if self == AndroidApp.CHIP_TVServer:
return ["platform-app", "content-app"]
else:
return None


class AndroidBuilder(Builder):

Expand Down Expand Up @@ -225,16 +231,29 @@ def gradlewBuildSrcAndroid(self):

def gradlewBuildExampleAndroid(self):
# Example compilation
self._Execute([
'%s/examples/%s/android/App/gradlew' % (self.root,
self.app.ExampleName()), '-p',
'%s/examples/%s/android/App/' % (self.root,
self.app.ExampleName()),
'-PmatterBuildSrcDir=%s' % self.output_dir,
'-PmatterSdkSourceBuild=false',
'-PbuildDir=%s' % self.output_dir, 'assembleDebug'
],
title='Building Example ' + self.identifier)
if self.app.Modules():
for module in self.app.Modules():
self._Execute([
'%s/examples/%s/android/App/gradlew' % (self.root,
self.app.ExampleName()), '-p',
'%s/examples/%s/android/App/' % (self.root,
self.app.ExampleName()),
'-PmatterBuildSrcDir=%s' % self.output_dir,
'-PmatterSdkSourceBuild=false',
'-PbuildDir=%s/%s' % (self.output_dir,module), ':%s:assembleDebug' % module
],
title='Building Example %s, module %s' %(self.identifier, module))
else:
self._Execute([
'%s/examples/%s/android/App/gradlew' % (self.root,
self.app.ExampleName()), '-p',
'%s/examples/%s/android/App/' % (self.root,
self.app.ExampleName()),
'-PmatterBuildSrcDir=%s' % self.output_dir,
'-PmatterSdkSourceBuild=false',
'-PbuildDir=%s' % self.output_dir, 'assembleDebug'
],
title='Building Example ' + self.identifier)

def generate(self):
self._Execute([
Expand Down
28 changes: 20 additions & 8 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,11 @@ cp {out}/android-arm-chip-tvserver/lib/third_party/connectedhomeip/src/app/serve

cp {out}/android-arm-chip-tvserver/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar

# Building Example android-arm-chip-tvserver
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tvserver assembleDebug
# Building Example android-arm-chip-tvserver, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tvserver/platform-app :platform-app:assembleDebug

# Building Example android-arm-chip-tvserver, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm-chip-tvserver/content-app :content-app:assembleDebug

# Building JNI android-arm64-chip-test
ninja -C {out}/android-arm64-chip-test
Expand Down Expand Up @@ -1191,8 +1194,11 @@ cp {out}/android-arm64-chip-tvserver/lib/third_party/connectedhomeip/src/app/ser

cp {out}/android-arm64-chip-tvserver/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar

# Building Example android-arm64-chip-tvserver
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-chip-tvserver assembleDebug
# Building Example android-arm64-chip-tvserver, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-chip-tvserver/platform-app :platform-app:assembleDebug

# Building Example android-arm64-chip-tvserver, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-arm64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-arm64-chip-tvserver/content-app :content-app:assembleDebug

# Building JNI android-x64-chip-tool
ninja -C {out}/android-x64-chip-tool
Expand Down Expand Up @@ -1235,8 +1241,11 @@ cp {out}/android-x64-chip-tvserver/lib/third_party/connectedhomeip/src/app/serve

cp {out}/android-x64-chip-tvserver/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar

# Building Example android-x64-chip-tvserver
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x64-chip-tvserver assembleDebug
# Building Example android-x64-chip-tvserver, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x64-chip-tvserver/platform-app :platform-app:assembleDebug

# Building Example android-x64-chip-tvserver, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x64-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x64-chip-tvserver/content-app :content-app:assembleDebug

# Building JNI android-x86-chip-tool
ninja -C {out}/android-x86-chip-tool
Expand Down Expand Up @@ -1279,8 +1288,11 @@ cp {out}/android-x86-chip-tvserver/lib/third_party/connectedhomeip/src/app/serve

cp {out}/android-x86-chip-tvserver/lib/TvApp.jar {root}/examples/tv-app/android/App/app/libs/TvApp.jar

# Building Example android-x86-chip-tvserver
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x86-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x86-chip-tvserver assembleDebug
# Building Example android-x86-chip-tvserver, module platform-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x86-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x86-chip-tvserver/platform-app :platform-app:assembleDebug

# Building Example android-x86-chip-tvserver, module content-app
{root}/examples/tv-app/android/App/gradlew -p {root}/examples/tv-app/android/App/ -PmatterBuildSrcDir={out}/android-x86-chip-tvserver -PmatterSdkSourceBuild=false -PbuildDir={out}/android-x86-chip-tvserver/content-app :content-app:assembleDebug

# Building bl602-light
ninja -C {out}/bl602-light
Expand Down

0 comments on commit 07400b6

Please sign in to comment.