Skip to content

Commit

Permalink
feat(android): allow modifying gradlew args in hooks (#5301)
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 authored May 30, 2020
1 parent 7e45718 commit 6684a3e
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/services/android/gradle-build-args-service.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import { Configurations } from "../../common/constants";

export class GradleBuildArgsService implements IGradleBuildArgsService {
constructor(private $androidToolsInfo: IAndroidToolsInfo,
private $hooksService: IHooksService,
private $analyticsService: IAnalyticsService,
private $staticConfig: Config.IStaticConfig,
private $logger: ILogger) { }
@@ -15,6 +16,9 @@ export class GradleBuildArgsService implements IGradleBuildArgsService {
args.push("-PgatherAnalyticsData=true");
}

// allow modifying gradle args from a `before-build-task-args` hook
await this.$hooksService.executeBeforeHooks('build-task-args', { hookArgs: { args } });

return args;
}

1 change: 1 addition & 0 deletions test/services/android/gradle-build-args-service.ts
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ function createTestInjector(): IInjector {
})
});
injector.register("logger", {});
injector.register("hooksService", stubs.HooksServiceStub);
injector.register("gradleBuildArgsService", GradleBuildArgsService);
injector.register("analyticsService", stubs.AnalyticsService);
injector.register("staticConfig", {TRACK_FEATURE_USAGE_SETTING_NAME: "TrackFeatureUsage"});

0 comments on commit 6684a3e

Please sign in to comment.