@Override protected DynamicObject getDynamicTarget() { if (inPluginRepositoriesBlock) { return new ExtraPropertiesDynamicObjectAdapter(Settings.class, ((ExtensibleDynamicObject) super.getDynamicTarget()).getDynamicProperties()); } else { return super.getDynamicTarget(); } }
@Override public void apply(Settings settings) { String pluginHost = getPortalHost(settings); PluginManifest pluginManifest = new ManifestRetriever(settings, pluginHost).getAvailablePlugins(); settings.getPluginManagement().resolutionStrategy(new ResolutionStrategyAction(pluginManifest)); settings.getPluginManagement().repositories(new RepositoryConfigurationAction(pluginManifest)); }
/** * @return The plugin portal host. */ private String getPortalHost(Settings settings) { Map<String, String> projectProperties = settings.getGradle().getStartParameter().getProjectProperties(); if (projectProperties.containsKey("plugin.portal.host")) { return projectProperties.get("plugin.portal.host"); } throw new GradleException("Property plugin.portal.host is unset!"); }
@Test public void testApplyPlugin() { Settings settings = mock(Settings.class); BuildCacheConfiguration conf = mock(BuildCacheConfiguration.class); when(settings.getBuildCache()).thenReturn(conf); AwsS3Plugin plugin = new AwsS3Plugin(); plugin.apply(settings); verify(conf).registerBuildCacheService(AwsS3BuildCache.class, AwsS3BuildCacheServiceFactory.class); }
@Override public void apply(Settings settings) { settings .getBuildCache() .registerBuildCacheService( CloudStorageBuildCache.class, CloudStorageBuildCacheServiceFactory.class); }
public Settings getSettings() { return this; }
public void configure(CommandLineParser parser) { parser.option(NO_SEARCH_UPWARDS, "no-search-upward").hasDescription(String.format("Don't search in parent folders for a %s file.", Settings.DEFAULT_SETTINGS_FILE)); parser.option(PROJECT_DIR, "project-dir").hasArgument().hasDescription("Specifies the start directory for Gradle. Defaults to current directory."); parser.option(GRADLE_USER_HOME, "gradle-user-home").hasArgument().hasDescription("Specifies the gradle user home directory."); }
public void settingsEvaluated(Settings settings) { buildProfile.setSettingsEvaluated(timeProvider.getCurrentTime()); }
public void settingsEvaluated(Settings settings) { }
public void settingsEvaluated(Settings settings) { SettingsInternal settingsInternal = (SettingsInternal) settings; logger.info("Settings evaluated using {}.", settingsInternal.getSettingsScript().getDisplayName()); }
public void settingsEvaluated(Settings settings) { if (settings.getGradle() == gradle) { logger.settingsEvaluated(); } }
public ManifestRetriever(Settings settings, String pluginHost) { this.settings = settings; this.pluginHost = pluginHost; }
@Override public void apply(Settings settings) { logger.info("Registering S3 build cache"); BuildCacheConfiguration buildCacheConfiguration = settings.getBuildCache(); buildCacheConfiguration.registerBuildCacheService(AwsS3BuildCache.class, AwsS3BuildCacheServiceFactory.class); }
public void settingsEvaluated(Settings settings) { SettingsInternal settingsInternal = (SettingsInternal) settings; logger.info(String.format("Settings evaluated using %s.", settingsInternal.getSettingsScript().getDisplayName())); }
@Override public void settingsEvaluated(Settings settings) { checkNotNull(settings); }
/** * <p>Called when the build settings have been loaded and evaluated. The settings object is fully configured and is ready to use to load the build projects.</p> * * @param settings The settings. Never null. */ public void settingsEvaluated(Settings settings) { //we don't really care }
/** * <p>Called when the build settings have been loaded and evaluated. The settings object is fully configured and is * ready to use to load the build projects.</p> * * @param settings The settings. Never null. */ void settingsEvaluated(Settings settings);