org.gradle.api.provider.Property Java Examples

The following examples show how to use org.gradle.api.provider.Property. 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: GithubClient.java    From gradle-plugins with MIT License 6 votes vote down vote up
public GithubClient(GithubExtension githubExtension, OkHttpClient okHttpClient) {

        OkHttpClient client = okHttpClient.newBuilder()
                .addInterceptor(chain -> {
                    Request request = chain.request();
                    Property<String> username = githubExtension.getUsername();
                    Property<String> token = githubExtension.getToken();
                    if (username.isPresent() && token.isPresent()) {
                        request = request.newBuilder()
                                .header("Authorization", Credentials.basic(username.get(), token.get()))
                                .build();
                    }
                    return chain.proceed(request);
                })
                .addInterceptor(this::logRateLimit)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl("https://api.github.com/")
                .client(client)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
 
Example #2
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> getDeleteStubsAfterTest() {
	return deleteStubsAfterTest;
}
 
Example #3
Source File: ModularJavaExec.java    From gradle-modules-plugin with MIT License 4 votes vote down vote up
private void execFixEffectiveArguments() {
    this.setJvmArgs(this.getJvmArgs());

    var hb = on(this).field("javaExecHandleBuilder").get();
    var handleBuilder = on(hb);
    String executable = handleBuilder.call("getExecutable").get();
    if (executable == null || executable.isEmpty()) throw new IllegalStateException("execCommand == null!");

    List<String> arguments = handleBuilder.field("javaOptions").call("getAllJvmArgs").get();
    LOGGER.info("run: raw jvmArgs = " + arguments);
    int idx = arguments.lastIndexOf("--module");
    if(idx < 0) {
        idx = arguments.lastIndexOf("-m");
    }
    if(idx >= 0 && idx < arguments.size() - 2) {
        List<String> fixedArgs = new ArrayList<>(arguments.subList(0, idx));
        fixedArgs.addAll(arguments.subList(idx + 2, arguments.size()));
        fixedArgs.addAll(arguments.subList(idx, idx+2));
        arguments = fixedArgs;
    }
    LOGGER.info("run: adjusted jvmArgs = " + arguments);
    if(idx < 0) {
        arguments.add(getMain());
    }

    arguments.addAll(getArgs());
    for (CommandLineArgumentProvider provider : getArgumentProviders()) {
        provider.asArguments().forEach(arguments::add);
    }
    LOGGER.info("run: effectiveArgs = " + arguments);

    var execHandle = onClass("org.gradle.process.internal.DefaultExecHandle").create(
            handleBuilder.call("getDisplayName").get(),
            handleBuilder.call("getWorkingDir").get(),
            executable,
            arguments,
            handleBuilder.call("getActualEnvironment").get(),
            handleBuilder.call("getEffectiveStreamsHandler").get(),
            handleBuilder.field("inputHandler").get(),
            handleBuilder.field("listeners").get(),
            handleBuilder.field("redirectErrorStream").get(),
            handleBuilder.field("timeoutMillis").get(),
            handleBuilder.field("daemon").get(),
            handleBuilder.field("executor").get(),
            handleBuilder.field("buildCancellationToken").get()
    );
    execHandle.call("start");
    ExecResult execResult = execHandle.call("waitForFinish").get();
    if (!this.isIgnoreExitValue()) {
        execResult.assertNormalExitValue();
    }
    if(GradleVersion.current().compareTo(GradleVersion.version("6.1")) >= 0) {
        ((Property<ExecResult>)this.getExecutionResult()).set(execResult);
    }
}
 
Example #4
Source File: DownloadZipAndUnpack.java    From native-samples with Apache License 2.0 4 votes vote down vote up
@Input
public Property<String> getUrl() {
    return url;
}
 
Example #5
Source File: DownloadWebDriver.java    From zap-extensions with Apache License 2.0 4 votes vote down vote up
@Input
public Property<Browser> getBrowser() {
    return browser;
}
 
Example #6
Source File: GenerateWrappersTask.java    From transport with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@InputFiles
public Property<FileCollection> getInputClassesDirs() {
  return _inputClassesDirs;
}
 
Example #7
Source File: ClojureBuild.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
public Property<SourceSet> getSourceSet() {
  return sourceSet;
}
 
Example #8
Source File: DefaultTwirlSourceSet.java    From playframework with Apache License 2.0 4 votes vote down vote up
@Override
public Property<TwirlImports> getDefaultImports() {
    return defaultImports;
}
 
Example #9
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
@Input
public Property<Boolean> getOptionalGettersForNullableFieldsOnly() {
    return optionalGettersForNullableFieldsOnly;
}
 
Example #10
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> getDisableStubPublication() {
	return disableStubPublication;
}
 
Example #11
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> getFailOnInProgress() {
	return failOnInProgress;
}
 
Example #12
Source File: CMakeExtension.java    From native-samples with Apache License 2.0 4 votes vote down vote up
public final Property<String> getBinary() {
    return binary;
}
 
Example #13
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<StubRunnerProperties.StubsMode> getContractsMode() {
	return contractsMode;
}
 
Example #14
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
@Input
public Property<String> getFieldVisibility() {
    return fieldVisibility;
}
 
Example #15
Source File: PlayRun.java    From playframework with Apache License 2.0 4 votes vote down vote up
@Nested
public Property<PlayPlatform> getPlatform() {
    return platform;
}
 
Example #16
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> isCreateSetters() {
    return createSetters;
}
 
Example #17
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> isEnableDecimalLogicalType() {
    return enableDecimalLogicalType;
}
 
Example #18
Source File: JibTask.java    From curiostack with MIT License 4 votes vote down vote up
@InputFile
public Property<Path> getExePath() {
  return exePath;
}
 
Example #19
Source File: DefaultAvroExtension.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public Property<Boolean> isCreateSetters() {
    return createSetters;
}
 
Example #20
Source File: ToolDownloaderExtension.java    From curiostack with MIT License 4 votes vote down vote up
/** The base URL to download tool packages from. Must follow Ivy repository conventions. */
Property<String> getBaseUrl();
 
Example #21
Source File: ToolDownloaderExtension.java    From curiostack with MIT License 4 votes vote down vote up
/** A value to use on Linux. */
Property<String> getLinux();
 
Example #22
Source File: DownloadWebDriver.java    From zap-extensions with Apache License 2.0 4 votes vote down vote up
@Input
public Property<OS> getOs() {
    return os;
}
 
Example #23
Source File: DownloadWebDriver.java    From zap-extensions with Apache License 2.0 4 votes vote down vote up
@Input
public Property<String> getVersion() {
    return version;
}
 
Example #24
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<Boolean> getConvertToYaml() {
	return convertToYaml;
}
 
Example #25
Source File: GitPublishExtension.java    From gradle-git-publish with Apache License 2.0 4 votes vote down vote up
public Property<String> getReferenceRepoUri() {
  return referenceRepoUri;
}
 
Example #26
Source File: GenerateAvroJavaTask.java    From gradle-avro-plugin with Apache License 2.0 4 votes vote down vote up
@Input
public Property<Boolean> getGettersReturnOptional() {
    return gettersReturnOptional;
}
 
Example #27
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<TestFramework> getTestFramework() {
	return testFramework;
}
 
Example #28
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<String> getSourceSet() {
	return sourceSet;
}
 
Example #29
Source File: ContractVerifierExtension.java    From spring-cloud-contract with Apache License 2.0 4 votes vote down vote up
public Property<String> getPackageWithBaseClasses() {
	return packageWithBaseClasses;
}
 
Example #30
Source File: NativeImageTask.java    From curiostack with MIT License 4 votes vote down vote up
@Input
public Property<String> getOutputName() {
  return outputName;
}