本文整理了Java中org.gradle.api.Project.getProperties()
方法的一些代码示例,展示了Project.getProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getProperties()
方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getProperties
暂无
代码示例来源:origin: jooby-project/jooby
private void configureApiTool(final Project project) {
project.getTasks()
.withType(ApiToolTask.class, task -> {
ConventionMapping mapping = task.getConventionMapping();
mapping.map("mainClassName", () -> project.getProperties().get("mainClassName"));
});
Map<String, Object> options = new HashMap<>();
options.put(Task.TASK_TYPE, ApiToolTask.class);
options.put(Task.TASK_DEPENDS_ON, "classes");
options.put(Task.TASK_NAME, "joobyApiTool");
options
.put(Task.TASK_DESCRIPTION, "Export your HTTP API to open standards like Swagger and RAML");
options.put(Task.TASK_GROUP, "jooby");
project.getTasks().create(options);
}
代码示例来源:origin: jooby-project/jooby
private void configureJoobyAssets(final Project project) {
project.getTasks()
.withType(AssetTask.class, task -> {
ConventionMapping mapping = task.getConventionMapping();
mapping.map("env", () -> "dist");
mapping.map("maxAge", () -> "365d");
mapping.map("mainClassName", () -> project.getProperties().get("mainClassName"));
mapping.map("output", () -> new JoobyProject(project).classes());
mapping.map("assemblyOutput", () -> new File(project.getBuildDir(), "__public_"));
});
Map<String, Object> options = new HashMap<>();
options.put(Task.TASK_TYPE, AssetTask.class);
options.put(Task.TASK_DEPENDS_ON, "classes");
options.put(Task.TASK_NAME, "joobyAssets");
options.put(Task.TASK_DESCRIPTION, "Process, optimize and compress static files");
options.put(Task.TASK_GROUP, "jooby");
project.getTasks().create(options);
}
代码示例来源:origin: jooby-project/jooby
private void configureJoobyRun(final Project project) {
project.getTasks()
.withType(JoobyTask.class, joobyRun -> {
ConventionMapping mapping = joobyRun.getConventionMapping();
mapping.map("classpath", () -> new JoobyProject(project).classpath());
mapping.map("src", () -> new JoobyProject(project).sources());
mapping.map("mainClassName", () -> project.getProperties().get("mainClassName"));
mapping.map("srcExtensions", () -> Arrays.asList(".java", ".conf", ".properties", ".kt"));
mapping.map("compiler", () -> {
File eclipseClasspath = new File(project.getProjectDir(), ".classpath");
return eclipseClasspath.exists() ? "off" : "on";
});
Gradle gradle = project.getGradle();
mapping.map("block", () -> !gradle.getStartParameter().isContinuous());
mapping.map("logLevel", () -> gradle.getStartParameter().getLogLevel().name());
});
Map<String, Object> options = new HashMap<>();
options.put(Task.TASK_TYPE, JoobyTask.class);
options.put(Task.TASK_DEPENDS_ON, "classes");
options.put(Task.TASK_NAME, "joobyRun");
options.put(Task.TASK_DESCRIPTION, "Run, debug and hot reload applications");
options.put(Task.TASK_GROUP, "jooby");
project.getTasks().create(options);
}
代码示例来源:origin: com.baidu.pyramid/util-gradle-plugin
/**
* gradle.properties配置pyramid.debug=true才能允许输出debug日志
* 这个是初始化配置的方法,在每个plugin.apply第一行调用
*
* @param project
* @return
*/
public static void resetDebug(Project project) {
Map<String, ?> propMap = project.getProperties();
Object debug = propMap.get("pyramid.debug");
DEBUG = (debug != null && "true".equalsIgnoreCase(debug.toString()));
}
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
private Map<String, String> getExtraInstrumentationTestRunnerArgsMap() {
Map<String, String> argsMap = Maps.newHashMap();
for (Map.Entry<String, ?> entry : project.getProperties().entrySet()) {
if (entry.getKey().startsWith(TEST_RUNNER_ARGS_PROP)) {
String argName = entry.getKey().substring(TEST_RUNNER_ARGS_PROP.length());
String argValue = entry.getValue().toString();
argsMap.put(argName, argValue);
}
}
return argsMap;
}
代码示例来源:origin: ibinti/bugvm
public String getIosSignIdentity() {
return project.hasProperty("bugvm.iosSignIdentity")
? project.getProperties().get("bugvm.iosSignIdentity").toString()
: iosSignIdentity;
}
代码示例来源:origin: ibinti/bugvm
public String getIosProvisioningProfile() {
return project.hasProperty("bugvm.iosProvisioningProfile")
? project.getProperties().get("bugvm.iosProvisioningProfile").toString()
: iosProvisioningProfile;
}
代码示例来源:origin: ibinti/bugvm
public String getIosSimulatorSdk() {
return project.hasProperty("bugvm.iosSimulatorSdk")
? project.getProperties().get("bugvm.iosSimulatorSdk").toString()
: iosSimulatorSdk;
}
代码示例来源:origin: ibinti/bugvm
public boolean isIosSkipSigning() {
return project.hasProperty("bugvm.iosSkipSigning")
? Boolean.parseBoolean(project.getProperties().get("bugvm.iosSkipSigning").toString())
: iosSkipSigning;
}
代码示例来源:origin: ibinti/bugvm
public int getDebugPort() {
return project.hasProperty("bugvm.debugPort")
? Integer.parseInt(project.getProperties().get("bugvm.debugPort").toString())
: debugPort;
}
代码示例来源:origin: ibinti/bugvm
public boolean isSkipLaunch() {
return project.hasProperty("bugvm.skipLaunch")
? Boolean.parseBoolean(project.getProperties().get("bugvm.skipLaunch").toString())
: skipLaunch;
}
代码示例来源:origin: ibinti/bugvm
public boolean isDebug() {
return project.hasProperty("bugvm.debug")
? Boolean.parseBoolean(project.getProperties().get("bugvm.debug").toString())
: debug;
}
代码示例来源:origin: ibinti/bugvm
public String getArchs() {
if (project.hasProperty("bugvm.archs")) {
return project.getProperties().get("bugvm.archs").toString();
}
return archs;
}
代码示例来源:origin: ibinti/bugvm
protected com.bugvm.compiler.target.ios.DeviceType getDeviceType(com.bugvm.compiler.target.ios.DeviceType.DeviceFamily family) {
String deviceName = (String) project.getProperties().get("bugvm.device.name");
String sdkVersion = (String) project.getProperties().get("bugvm.sdk.version");
return com.bugvm.compiler.target.ios.DeviceType.getBestDeviceType(getArch(), family, deviceName, sdkVersion);
}
}
代码示例来源:origin: com.netflix.nebula/nebula-dependency-recommender
public List<ValueSource> createValueSources(Model model, File projectDir, ModelBuildingRequest request, ModelProblemCollector collector) {
List<ValueSource> sources = new ArrayList<>();
sources.addAll(super.createValueSources(model, projectDir, request, collector));
sources.add(new PropertiesBasedValueSource(System.getProperties()));
sources.add(new MapBasedValueSource(project.getProperties()));
return sources;
}
}
代码示例来源:origin: gradle.plugin.com.github.rmee/jpa-schema-gen
private SourceSet getMainSourceSet() {
Project project = getProject();
SourceSetContainer sourceSets = (SourceSetContainer) project.getProperties().get("sourceSets");
return sourceSets.getByName("main");
}
代码示例来源:origin: com.android.tools.build/gradle-core
private void forEachUnalignedInput(InputProcessor processor) {
String archivesBaseName = (String)getProject().getProperties().get("archivesBaseName");
Pattern unalignedPattern = Pattern.compile(
archivesBaseName + "-" + outputBaseName + "_(.*)-unaligned.apk");
for (File file : getInputFiles()) {
Matcher unaligned = unalignedPattern.matcher(file.getName());
if (unaligned.matches() && isFilter(unaligned.group(1))) {
processor.process(unaligned.group(1), file);
}
}
}
代码示例来源:origin: gradle.plugin.com.github.opengl-8080/assertjGen-gradle-plugin
private SourceSetHelper getSourceSet(String name) {
SourceSetContainer sourceSets = (SourceSetContainer) this.project.getProperties().get("sourceSets");
SourceSet sourceSet = sourceSets.getByName(name);
return new SourceSetHelper(sourceSet);
}
代码示例来源:origin: com.android.tools.build/gradle-core
private String getApkName(final String split) {
String archivesBaseName = (String)getProject().getProperties().get("archivesBaseName");
String apkName = archivesBaseName + "-" + getOutputBaseName() + "_" + split;
return apkName + (getSigningConfig() == null ? "-unsigned.apk" : "-unaligned.apk");
}
代码示例来源:origin: com.amazon.device.tools.build/gradle-core
@NonNull
public String getApkLocation() {
String apkLocation = getDefaultApkLocation();
if (project.hasProperty(PROPERTY_APK_LOCATION)) {
apkLocation = (String) project.getProperties().get(PROPERTY_APK_LOCATION);
}
return apkLocation;
}
}
内容来源于网络,如有侵权,请联系作者删除!