Skip to content

Commit

Permalink
Cleanup obsolete build steps for java-matter-controller (#25170)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored Feb 17, 2023
1 parent 01b88b4 commit 97b5370
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions scripts/build/builders/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def AppName(self):
return "tv-server"
elif self == AndroidApp.TV_CASTING_APP:
return "tv-casting"
elif self == AndroidApp.JAVA_MATTER_CONTROLLER:
return "java-matter-controller"
else:
raise Exception("Unknown app type: %r" % self)

Expand All @@ -99,8 +97,6 @@ def ExampleName(self):
return "tv-app"
elif self == AndroidApp.TV_CASTING_APP:
return "tv-casting-app"
elif self == AndroidApp.JAVA_MATTER_CONTROLLER:
return "java-matter-controller"
else:
return None

Expand Down Expand Up @@ -294,16 +290,6 @@ def gradlewBuildExampleAndroid(self):
title="Building Example " + self.identifier,
)

def createJavaExecutable(self, java_program):
self._Execute(
[
"chmod",
"+x",
"%s/bin/%s" % (self.output_dir, java_program),
],
title="Make Java program executable",
)

def generate(self):
self._Execute(
["python3", "third_party/android_deps/set_up_android_deps.py"],
Expand Down Expand Up @@ -349,10 +335,7 @@ def generate(self):

exampleName = self.app.ExampleName()
if exampleName is not None:
if exampleName == "java-matter-controller":
gn_gen += ["--root=%s/examples/%s/" % (self.root, exampleName)]
else:
gn_gen += ["--root=%s/examples/%s/android/" % (self.root, exampleName)]
gn_gen += ["--root=%s/examples/%s/android/" % (self.root, exampleName)]

if self.board.IsIde():
gn_gen += [
Expand Down Expand Up @@ -384,15 +367,6 @@ def generate(self):
)

app_dir = os.path.join(self.root, "examples/", self.app.AppName())
if exampleName == "java-matter-controller":
self._Execute(
[
"cp",
os.path.join(app_dir, "Manifest.txt"),
self.output_dir,
],
title="Copying Manifest.txt to " + self.output_dir,
)

def _build(self):
if self.board.IsIde():
Expand Down Expand Up @@ -420,32 +394,6 @@ def _build(self):
if exampleName is None:
self.copyToSrcAndroid()
self.gradlewBuildSrcAndroid()
elif exampleName == "java-matter-controller":
jnilibs_dir = os.path.join(
self.root,
"examples/",
self.app.ExampleName(),
"app/libs/jniLibs",
self.board.AbiName(),
)

libs_dir = os.path.join(
self.root, "examples/", self.app.ExampleName(), "app/libs"
)

libs = [
"libSetupPayloadParser.so",
"libCHIPController.so",
"libc++_shared.so",
]

jars = {
"CHIPController.jar": "third_party/connectedhomeip/src/controller/java/CHIPController.jar",
"SetupPayloadParser.jar": "third_party/connectedhomeip/src/setup_payload/java/SetupPayloadParser.jar",
}

self.copyToExampleApp(jnilibs_dir, libs_dir, libs, jars)
self.createJavaExecutable("java-matter-controller")
elif exampleName == "tv-casting-app":
jnilibs_dir = os.path.join(
self.root,
Expand Down

0 comments on commit 97b5370

Please sign in to comment.