Skip to content

Commit

Permalink
feat(aar): added configurable bundle name (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan-dutoit authored and satya164 committed Jun 28, 2019
1 parent bf44f8f commit 6f04c04
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/targets/aar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import jetifier from '../utils/jetifier';

type TargetOptions = {
androidPath: string,
androidBundleName: string;
reverseJetify: boolean
};

const defaultOptions: TargetOptions = {
androidPath: "android",
androidBundleName: "android.aar",
reverseJetify: false
};

Expand Down Expand Up @@ -49,8 +51,8 @@ export default async function build({
);
await fs.mkdir(output);

const sourceAar = path.join(targetOptions.androidPath, 'build', 'outputs', 'aar', 'android.aar');
const targetAar = path.join(output, 'android.aar');
const sourceAar = path.join(targetOptions.androidPath, 'build', 'outputs', 'aar', targetOptions.androidBundleName);
const targetAar = path.join(output, targetOptions.androidBundleName);

report.info(
`Copying AAR from ${chalk.blue(path.relative(root, sourceAar))} to ${chalk.blue(path.relative(root, targetAar))}`
Expand All @@ -70,7 +72,7 @@ export default async function build({
);
await fs.mkdir(supportOutputPath);

const supportAar = path.join(supportOutputPath, 'android.aar');
const supportAar = path.join(supportOutputPath, targetOptions.androidBundleName);
report.info(
`Using Jetifier to convert AAR from AndroidX to Support AAR at ${chalk.blue(path.relative(root, supportAar))}`
);
Expand Down

0 comments on commit 6f04c04

Please sign in to comment.