Minor cleanup
This commit is contained in:
parent
ca6efe2306
commit
79dbc093f4
4 changed files with 45 additions and 39 deletions
|
@ -25,7 +25,7 @@ public class GeneratedVersionOperationBuild extends Project {
|
|||
autoDownloadPurge = true;
|
||||
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||
|
||||
var rife2 = version(1,7,0);
|
||||
var rife2 = version(1, 7, 0);
|
||||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "rife2", rife2))
|
||||
.include(dependency("com.uwyn.rife2", "bld", rife2));
|
||||
|
|
|
@ -42,41 +42,6 @@ public class GeneratedVersion {
|
|||
return classFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class name.
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the package name.
|
||||
*/
|
||||
public String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project.
|
||||
*/
|
||||
public BaseProject getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project name.
|
||||
*/
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template.
|
||||
*/
|
||||
public File getTemplate() {
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class file.
|
||||
*/
|
||||
|
@ -84,6 +49,13 @@ public class GeneratedVersion {
|
|||
this.classFile = classFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class name.
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the class name.
|
||||
*/
|
||||
|
@ -91,6 +63,13 @@ public class GeneratedVersion {
|
|||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the package name.
|
||||
*/
|
||||
public String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the package name.
|
||||
*/
|
||||
|
@ -98,6 +77,13 @@ public class GeneratedVersion {
|
|||
this.packageName = packageName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project.
|
||||
*/
|
||||
public BaseProject getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the project.
|
||||
*/
|
||||
|
@ -105,6 +91,13 @@ public class GeneratedVersion {
|
|||
this.project = project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project name.
|
||||
*/
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the project name.
|
||||
*/
|
||||
|
@ -112,6 +105,13 @@ public class GeneratedVersion {
|
|||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template.
|
||||
*/
|
||||
public File getTemplate() {
|
||||
return template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the template file.
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
|
|||
if (gv.getTemplate() == null) {
|
||||
template = TemplateFactory.TXT.get("version.txt");
|
||||
} else {
|
||||
var files = new ResourceFinderDirectories(new File[]{gv.getTemplate().getParentFile()});
|
||||
var files = new ResourceFinderDirectories(gv.getTemplate().getParentFile());
|
||||
template = new TemplateFactory(TemplateConfig.TXT, "txtFiles", TemplateFactory.TXT)
|
||||
.setResourceFinder(files).get(gv.getTemplate().getName());
|
||||
}
|
||||
|
@ -135,8 +135,9 @@ public class GeneratedVersionOperation extends AbstractOperation<GeneratedVersio
|
|||
var updated = gv.getClassFile().exists();
|
||||
FileUtils.writeString(template.getContent(), gv.getClassFile());
|
||||
if (LOGGER.isLoggable(Level.INFO)) {
|
||||
LOGGER.log(Level.INFO, "Generated version class has been {0}: {1}",
|
||||
new String[]{updated ? "updated" : "created", gv.getClassFile().toString()});
|
||||
LOGGER.log(Level.INFO, "Generated version class has been {0} to {1}: {2}",
|
||||
new String[]{updated ? "updated" : "created", gv.getProject().version().toString(),
|
||||
gv.getClassFile().toString()});
|
||||
}
|
||||
} catch (IOException e) {
|
||||
if (LOGGER.isLoggable(Level.SEVERE)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue