Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/common/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,11 @@ interface IDashedOption {
* Specifies either a single option key (string), or an array of options that must be followed by option values.
*/
requiresArg?: any;

/**
* Set to true to define the option as an array option https://github.com/yargs/yargs/blob/main/docs/api.md#array
*/
array?: any;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ interface IAndroidBundleOptions {

interface IAndroidOptions {
gradlePath: string;
gradleArgs: string;
gradleArgs: string[];
}

interface ITypingsOptions {
Expand Down
4 changes: 2 additions & 2 deletions lib/definitions/android-plugin-migrator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IAndroidBuildOptions {
aarOutputDir: string;
tempPluginDirPath: string;
gradlePath?: string;
gradleArgs?: string;
gradleArgs?: string[];
}

interface IAndroidPluginBuildService {
Expand Down Expand Up @@ -48,5 +48,5 @@ interface IBuildAndroidPluginData extends Partial<IProjectDir> {
/**
* Optional custom Gradle arguments.
*/
gradleArgs?: string,
gradleArgs?: string[],
}
2 changes: 1 addition & 1 deletion lib/definitions/build.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface IAndroidBuildData
IAndroidSigningData,
IHasAndroidBundle {
gradlePath?: string;
gradleArgs?: string;
gradleArgs?: string[];
}

interface IAndroidSigningData {
Expand Down
2 changes: 1 addition & 1 deletion lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class Options {
hasSensitiveValue: false,
},
gradlePath: { type: OptionType.String, hasSensitiveValue: false },
gradleArgs: { type: OptionType.String, hasSensitiveValue: false },
gradleArgs: { type: OptionType.String, hasSensitiveValue: false, array: true },
aab: { type: OptionType.Boolean, hasSensitiveValue: false },
performance: { type: OptionType.Object, hasSensitiveValue: true },
appleApplicationSpecificPassword: {
Expand Down
6 changes: 5 additions & 1 deletion lib/services/android-plugin-build-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,11 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
`-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`
];
if (pluginBuildSettings.gradleArgs) {
localArgs.push(pluginBuildSettings.gradleArgs);
const additionalArgs: string[] = []
pluginBuildSettings.gradleArgs.forEach(arg=>{
additionalArgs.push(...arg.split(' -P').map((a,i) => i === 0 ? a : `-P${a}`));
});
localArgs.push(...additionalArgs);
}

if (this.$logger.getLevel() === "INFO") {
Expand Down
6 changes: 5 additions & 1 deletion lib/services/android/gradle-build-args-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export class GradleBuildArgsService implements IGradleBuildArgsService {
`-PappResourcesPath=${this.$projectData.getAppResourcesDirectoryPath()}`
);
if (buildData.gradleArgs) {
args.push(buildData.gradleArgs);
const additionalArgs: string[] = []
buildData.gradleArgs.forEach(arg=>{
additionalArgs.push(...arg.split(' -P').map((a,i) => i === 0 ? a : `-P${a}`));
});
args.push(...additionalArgs);
}

if (buildData.release) {
Expand Down