Java Code Examples for org.gradle.StartParameter#newBuild()

The following examples show how to use org.gradle.StartParameter#newBuild() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SettingsHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Finds the settings.gradle for the given startParameter, and loads it if contains the project selected by the
 * startParameter, or if the startParameter explicitly specifies a settings script.  If the settings file is not
 * loaded (executed), then a null is returned.
 */
private SettingsInternal findSettingsAndLoadIfAppropriate(GradleInternal gradle,
                                                          StartParameter startParameter) {
    SettingsLocation settingsLocation = findSettings(startParameter);

    // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
    // the settings script to reference classes in the buildSrc.
    StartParameter buildSrcStartParameter = startParameter.newBuild();
    buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(), BaseSettings.DEFAULT_BUILD_SRC_DIR));
    ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

    return settingsProcessor.process(gradle, settingsLocation, buildSourceClassLoader, startParameter);
}
 
Example 2
Source File: SettingsHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Finds the settings.gradle for the given startParameter, and loads it if contains the project selected by the
 * startParameter, or if the startParameter explicitly specifies a settings script.  If the settings file is not
 * loaded (executed), then a null is returned.
 */
private SettingsInternal findSettingsAndLoadIfAppropriate(GradleInternal gradle,
                                                          StartParameter startParameter) {
    SettingsLocation settingsLocation = findSettings(startParameter);

    // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
    // the settings script to reference classes in the buildSrc.
    StartParameter buildSrcStartParameter = startParameter.newBuild();
    buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(),
            BaseSettings.DEFAULT_BUILD_SRC_DIR));
    ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

    return loadSettings(gradle, settingsLocation, buildSourceClassLoader.createRebasedChild(), startParameter);
}
 
Example 3
Source File: SettingsHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Finds the settings.gradle for the given startParameter, and loads it if contains the project selected by the
 * startParameter, or if the startParameter explicitly specifies a settings script.  If the settings file is not
 * loaded (executed), then a null is returned.
 */
private SettingsInternal findSettingsAndLoadIfAppropriate(GradleInternal gradle,
                                                          StartParameter startParameter) {
    SettingsLocation settingsLocation = findSettings(startParameter);

    // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
    // the settings script to reference classes in the buildSrc.
    StartParameter buildSrcStartParameter = startParameter.newBuild();
    buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(), BaseSettings.DEFAULT_BUILD_SRC_DIR));
    ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

    return settingsProcessor.process(gradle, settingsLocation, buildSourceClassLoader, startParameter);
}
 
Example 4
Source File: SettingsHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Finds the settings.gradle for the given startParameter, and loads it if contains the project selected by the
 * startParameter, or if the startParameter explicitly specifies a settings script.  If the settings file is not
 * loaded (executed), then a null is returned.
 */
private SettingsInternal findSettingsAndLoadIfAppropriate(GradleInternal gradle,
                                                          StartParameter startParameter) {
    SettingsLocation settingsLocation = findSettings(startParameter);

    // We found the desired settings file, now build the associated buildSrc before loading settings.  This allows
    // the settings script to reference classes in the buildSrc.
    StartParameter buildSrcStartParameter = startParameter.newBuild();
    buildSrcStartParameter.setCurrentDir(new File(settingsLocation.getSettingsDir(),
            BaseSettings.DEFAULT_BUILD_SRC_DIR));
    ClassLoaderScope buildSourceClassLoader = buildSourceBuilder.buildAndCreateClassLoader(buildSrcStartParameter);

    return loadSettings(gradle, settingsLocation, buildSourceClassLoader.createRebasedChild(), startParameter);
}
 
Example 5
Source File: GradleBuild.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Inject
public GradleBuild(StartParameter currentBuild, GradleLauncherFactory gradleLauncherFactory) {
    this.gradleLauncherFactory = gradleLauncherFactory;
    this.startParameter = currentBuild.newBuild();
    startParameter.setCurrentDir(getProject().getProjectDir());
}
 
Example 6
Source File: GradleBuild.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Inject
public GradleBuild(StartParameter currentBuild, GradleLauncherFactory gradleLauncherFactory) {
    this.gradleLauncherFactory = gradleLauncherFactory;
    this.startParameter = currentBuild.newBuild();
    startParameter.setCurrentDir(getProject().getProjectDir());
}