Added file paths to log.
This commit is contained in:
parent
e735ca02ed
commit
d72dab7593
1 changed files with 26 additions and 20 deletions
|
@ -76,10 +76,11 @@ public class VersionProcessor extends AbstractProcessor {
|
||||||
if (version.properties().length() > 0) {
|
if (version.properties().length() > 0) {
|
||||||
final File propsFile = new File(version.properties());
|
final File propsFile = new File(version.properties());
|
||||||
if (propsFile.exists()) {
|
if (propsFile.exists()) {
|
||||||
note("Found properties: " + propsFile);
|
note("Found properties: " + propsFile + " (" + propsFile.getAbsoluteFile().getParent() + ')');
|
||||||
|
|
||||||
final Properties p = new Properties();
|
final Properties p = new Properties();
|
||||||
|
|
||||||
try (FileReader reader = new FileReader(propsFile)) {
|
try (final FileReader reader = new FileReader(propsFile)) {
|
||||||
p.load(reader);
|
p.load(reader);
|
||||||
|
|
||||||
versionInfo.setProject(
|
versionInfo.setProject(
|
||||||
|
@ -196,19 +197,24 @@ public class VersionProcessor extends AbstractProcessor {
|
||||||
final Mustache mustache = mf.compile(template);
|
final Mustache mustache = mf.compile(template);
|
||||||
|
|
||||||
final String templateName;
|
final String templateName;
|
||||||
if (mustache.getName().equals(Constants.DEFAULT_JAVA_TEMPLATE)) {
|
switch (mustache.getName()) {
|
||||||
|
case Constants.DEFAULT_JAVA_TEMPLATE:
|
||||||
templateName = "default (Java)";
|
templateName = "default (Java)";
|
||||||
} else if (mustache.getName().equals(Constants.DEFAULT_KOTLIN_TEMPLATE)) {
|
break;
|
||||||
|
case Constants.DEFAULT_KOTLIN_TEMPLATE:
|
||||||
templateName = "default (Kotlin)";
|
templateName = "default (Kotlin)";
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
templateName = mustache.getName();
|
templateName = mustache.getName();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
note("Loaded template: " + templateName);
|
note("Loaded template: " + templateName);
|
||||||
|
|
||||||
final FileObject jfo;
|
final FileObject jfo;
|
||||||
|
final String fileName = versionInfo.getClassName() + '.' + type;
|
||||||
if (type.equalsIgnoreCase(Constants.KOTLIN_TYPE)) {
|
if (type.equalsIgnoreCase(Constants.KOTLIN_TYPE)) {
|
||||||
jfo = filer.createResource(StandardLocation.SOURCE_OUTPUT, versionInfo.getPackageName(),
|
jfo = filer.createResource(StandardLocation.SOURCE_OUTPUT, versionInfo.getPackageName(),
|
||||||
versionInfo.getClassName() + '.' + type);
|
fileName);
|
||||||
} else {
|
} else {
|
||||||
jfo = filer.createSourceFile(versionInfo.getPackageName() + '.' + versionInfo.getClassName());
|
jfo = filer.createSourceFile(versionInfo.getPackageName() + '.' + versionInfo.getClassName());
|
||||||
}
|
}
|
||||||
|
@ -217,7 +223,7 @@ public class VersionProcessor extends AbstractProcessor {
|
||||||
mustache.execute(writer, versionInfo).flush();
|
mustache.execute(writer, versionInfo).flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
note("Generated source: " + jfo.getName());
|
note("Generated source: " + fileName + " (" + new File(jfo.getName()).getAbsoluteFile().getParent() + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue