Support Structure101 License ID

Closes gh-10443
This commit is contained in:
Josh Cummings
2021-10-26 15:10:28 -06:00
parent 7a99542662
commit d779cd1d48
4 changed files with 52 additions and 10 deletions

View File

@@ -24,18 +24,18 @@ import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputDirectory;
public class S101PluginExtension {
private final Property<File> licenseDirectory;
private final Property<String> licenseId;
private final Property<File> installationDirectory;
private final Property<File> configurationDirectory;
private final Property<String> label;
@InputDirectory
public Property<File> getLicenseDirectory() {
return this.licenseDirectory;
@Input
public Property<String> getLicenseId() {
return this.licenseId;
}
public void setLicenseDirectory(String licenseDirectory) {
this.licenseDirectory.set(new File(licenseDirectory));
public void setLicenseId(String licenseId) {
this.licenseId.set(licenseId);
}
@InputDirectory
@@ -66,8 +66,10 @@ public class S101PluginExtension {
}
public S101PluginExtension(Project project) {
this.licenseDirectory = project.getObjects().property(File.class)
.convention(new File(System.getProperty("user.home") + "/.Structure101/java"));
this.licenseId = project.getObjects().property(String.class);
if (project.hasProperty("s101.licenseId")) {
setLicenseId((String) project.findProperty("s101.licenseId"));
}
this.installationDirectory = project.getObjects().property(File.class)
.convention(new File(project.getBuildDir(), "s101"));
this.configurationDirectory = project.getObjects().property(File.class)