Skip to content

Commit

Permalink
fix gradle output path (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxded authored Oct 25, 2024
1 parent 1e7ac6c commit 7353c59
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions xbuild/src/gradle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ pub fn build(env: &BuildEnv, libraries: Vec<(Target, PathBuf)>, out: &Path) -> R
Format::Apk => "assemble",
_ => unreachable!(),
});

task::run(cmd, true)?;
let output = gradle
.join("app")
Expand All @@ -227,14 +228,22 @@ pub fn build(env: &BuildEnv, libraries: Vec<(Target, PathBuf)>, out: &Path) -> R
Format::Apk => "apk",
_ => unreachable!(),
})
.join(opt.to_string())
.join(match (format, opt) {
(Format::Apk, Opt::Debug) => "app-debug.apk",
(Format::Apk, Opt::Release) => "app-release-unsigned.apk",
(Format::Aab, Opt::Debug) => "app-debug.aab",
(Format::Aab, Opt::Release) => "app-release.aab",
_ => unreachable!(),
.join(match opt {
Opt::Debug => "debug",
Opt::Release | Opt::Profile(_) => "release",
})
.join({
match (format, opt) {
(Format::Apk, Opt::Debug) => "app-debug.apk",
(Format::Apk, Opt::Release) | (Format::Apk, Opt::Profile(_)) => {
"app-release-unsigned.apk"
}
(Format::Aab, Opt::Debug) => "app-debug.aab",
(Format::Aab, Opt::Release) | (Format::Aab, Opt::Profile(_)) => "app-release.aab",
_ => unreachable!(),
}
});

std::fs::copy(output, out)?;
Ok(())
}

0 comments on commit 7353c59

Please sign in to comment.