Merge branch '12-add-version-to-generated-annotation' into 'main'

Resolve "add version to generated annotation"

Closes #12

See merge request nairah1/jackfruit!12
This commit is contained in:
Hari Nair
2022-11-27 17:12:53 +00:00
4 changed files with 11 additions and 7 deletions

View File

@@ -189,6 +189,6 @@ If you'd like to create a configuration object that differs from the template po
config = factory.withIntMethod(config, 4);
```
This replaces the "doubles" and the "key" properties. The "with" methods are just wrappers around the "setProperty" method of the PropertiesConfiguration class.
This replaces the "doubles" and the "key" properties. The "with" methods are just wrappers around the "setProperty" method of the PropertiesConfiguration class. You can now use `fromConfig()` to create a new DemoInterface object with the updated values.

View File

@@ -4,7 +4,7 @@
cd $(dirname $0)
rev=$(git rev-parse --verify --short HEAD)
rev=$(git rev-parse --verify --short=8 HEAD)
if [ $? -gt 0 ]; then
rev="UNKNOWN"
fi
@@ -14,7 +14,9 @@ if [ $? -gt 0 ]; then
branch="UNKNOWN"
fi
package=Jackfruit
date=$(date -u +"%y.%m.%d")
package=jackfruit
srcFile="../java/jackfruit/JackfruitVersion.java"
mkdir -p $(dirname $srcFile)
@@ -27,6 +29,7 @@ package jackfruit;
public class JackfruitVersion {
public final static String rev = new String("$rev");
public final static String packageName = new String("$package");
public final static String dateString = new String("$date");
public final static String branch = new String("$branch");
}

View File

@@ -2,8 +2,9 @@
package jackfruit;
public class JackfruitVersion {
public final static String rev = new String("168ca45");
public final static String packageName = new String("Jackfruit");
public final static String branch = new String("11-add-createconfig");
public final static String rev = new String("9ad69b62");
public final static String packageName = new String("jackfruit");
public final static String dateString = new String("22.11.27");
public final static String branch = new String("UNKNOWN");
}

View File

@@ -120,7 +120,7 @@ public class ConfigProcessor extends AbstractProcessor {
AnnotationSpec generated = AnnotationSpec.builder(Generated.class)
.addMember("value", String.format("\"%s\"", JackfruitVersion.packageName))
.addMember("date", String.format("\"%s\"", formatter.format(now)))
.addMember("comments", String.format("\"branch %s (%s)\"", JackfruitVersion.branch,
.addMember("comments", String.format("\"version %s-%s\"", JackfruitVersion.dateString,
JackfruitVersion.rev))
.build();