diff --git a/example/.gitignore b/example/.gitignore
new file mode 100644
index 0000000..a63b224
--- /dev/null
+++ b/example/.gitignore
@@ -0,0 +1,55 @@
+.gradle
+.DS_Store
+build
+lib/bld/**
+lib/compile/**
+lib/runtime/**
+lib/standalone/**
+lib/test/**
+!bld-wrapper.jar
+!bld-wrapper.properties
+
+# IDEA ignores
+
+# User-specific
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Editor-based Rest Client
+.idea/httpRequests
\ No newline at end of file
diff --git a/example/.idea/.gitignore b/example/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/example/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/example/.idea/.name b/example/.idea/.name
new file mode 100644
index 0000000..84c8d99
--- /dev/null
+++ b/example/.idea/.name
@@ -0,0 +1 @@
+bld-generated-version-example
diff --git a/example/.idea/app.iml b/example/.idea/app.iml
new file mode 100644
index 0000000..787b59b
--- /dev/null
+++ b/example/.idea/app.iml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/bld.iml b/example/.idea/bld.iml
new file mode 100644
index 0000000..e63e11e
--- /dev/null
+++ b/example/.idea/bld.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/inspectionProfiles/Project_Default.xml b/example/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1e01b48
--- /dev/null
+++ b/example/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/libraries/bld.xml b/example/.idea/libraries/bld.xml
new file mode 100644
index 0000000..7596927
--- /dev/null
+++ b/example/.idea/libraries/bld.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/libraries/compile.xml b/example/.idea/libraries/compile.xml
new file mode 100644
index 0000000..9bd86aa
--- /dev/null
+++ b/example/.idea/libraries/compile.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/libraries/runtime.xml b/example/.idea/libraries/runtime.xml
new file mode 100644
index 0000000..2ae5c4b
--- /dev/null
+++ b/example/.idea/libraries/runtime.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/libraries/test.xml b/example/.idea/libraries/test.xml
new file mode 100644
index 0000000..b80486a
--- /dev/null
+++ b/example/.idea/libraries/test.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/misc.xml b/example/.idea/misc.xml
new file mode 100644
index 0000000..c958614
--- /dev/null
+++ b/example/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/modules.xml b/example/.idea/modules.xml
new file mode 100644
index 0000000..55adcb9
--- /dev/null
+++ b/example/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/runConfigurations/Run Main.xml b/example/.idea/runConfigurations/Run Main.xml
new file mode 100644
index 0000000..29c79eb
--- /dev/null
+++ b/example/.idea/runConfigurations/Run Main.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/runConfigurations/Run Tests.xml b/example/.idea/runConfigurations/Run Tests.xml
new file mode 100644
index 0000000..16fea3c
--- /dev/null
+++ b/example/.idea/runConfigurations/Run Tests.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.idea/vcs.xml b/example/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/example/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/.vscode/launch.json b/example/.vscode/launch.json
new file mode 100644
index 0000000..dc9c983
--- /dev/null
+++ b/example/.vscode/launch.json
@@ -0,0 +1,24 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "java",
+ "name": "Run Main",
+ "request": "launch",
+ "mainClass": "com.example.SampleMain"
+ },
+ {
+ "type": "java",
+ "name": "Run Tests",
+ "request": "launch",
+ "mainClass": "org.junit.platform.console.ConsoleLauncher",
+ "args": [
+ "--details=verbose",
+ "--scan-classpath",
+ "--disable-banner",
+ "--disable-ansi-colors",
+ "--exclude-engine=junit-platform-suite",
+ "--exclude-engine=junit-vintage"]
+ }
+ ]
+}
diff --git a/example/.vscode/settings.json b/example/.vscode/settings.json
new file mode 100644
index 0000000..4fdc74b
--- /dev/null
+++ b/example/.vscode/settings.json
@@ -0,0 +1,15 @@
+{
+ "java.project.sourcePaths": [
+ "src/main/java",
+ "src/main/resources",
+ "src/test/java",
+ "src/bld/java"
+ ],
+ "java.configuration.updateBuildConfiguration": "automatic",
+ "java.project.referencedLibraries": [
+ "${HOME}/.rife2/dist/rife2-1.6.1.jar",
+ "lib/compile/*.jar",
+ "lib/runtime/*.jar",
+ "lib/test/*.jar"
+ ]
+}
diff --git a/example/bld b/example/bld
new file mode 100755
index 0000000..dc8f609
--- /dev/null
+++ b/example/bld
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build com.example.SampleBuild "$@"
\ No newline at end of file
diff --git a/example/bld.bat b/example/bld.bat
new file mode 100644
index 0000000..a31285e
--- /dev/null
+++ b/example/bld.bat
@@ -0,0 +1,4 @@
+@echo off
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build com.example.SampleBuild %*
\ No newline at end of file
diff --git a/example/lib/bld/bld-wrapper.jar b/example/lib/bld/bld-wrapper.jar
new file mode 100644
index 0000000..8c61457
Binary files /dev/null and b/example/lib/bld/bld-wrapper.jar differ
diff --git a/example/lib/bld/bld-wrapper.properties b/example/lib/bld/bld-wrapper.properties
new file mode 100644
index 0000000..222b967
--- /dev/null
+++ b/example/lib/bld/bld-wrapper.properties
@@ -0,0 +1,6 @@
+bld.downloadExtensionJavadoc=false
+bld.downloadExtensionSources=true
+bld.extensions=com.uwyn.rife2:bld-generated-version:0.9.0-SNAPSHOT
+bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2,RIFE2_SNAPSHOTS
+rife2.downloadLocation=
+rife2.version=1.6.1
diff --git a/example/myversion.txt b/example/myversion.txt
new file mode 100644
index 0000000..186b39b
--- /dev/null
+++ b/example/myversion.txt
@@ -0,0 +1,17 @@
+package {{v packageName/}};
+
+import java.util.Date;
+
+public final class {{v className/}} {
+ public static final String PROJECT = "{{v project/}}";
+ public static final Date BUILD_DATE = new Date({{v epoch/}}L);
+ public static final int MAJOR = {{v major/}};
+ public static final int MINOR = {{v minor/}};
+ public static final int REVISION = {{v revision/}};
+ public static final String QUALIFIER = "{{v qualifier/}}";
+ public static final String VERSION = "{{v version/}}";
+
+ private {{v className/}}() {
+ throw new UnsupportedOperationException("Illegal constructor call.");
+ }
+}
\ No newline at end of file
diff --git a/example/src/bld/java/com/example/SampleBuild.java b/example/src/bld/java/com/example/SampleBuild.java
new file mode 100644
index 0000000..a09224b
--- /dev/null
+++ b/example/src/bld/java/com/example/SampleBuild.java
@@ -0,0 +1,45 @@
+package com.example;
+
+import rife.bld.BuildCommand;
+import rife.bld.Project;
+import rife.bld.extension.GeneratedVersionOperation;
+
+import java.io.File;
+import java.util.List;
+
+import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
+import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
+import static rife.bld.dependencies.Scope.test;
+
+public class SampleBuild extends Project {
+ public SampleBuild() {
+ pkg = "com.example";
+ name = "Sample";
+ mainClass = "com.example.SampleMain";
+ version = version(1, 0, 1, "rc1");
+
+ downloadSources = true;
+ repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
+ scope(test)
+ .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2)))
+ .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 2)));
+ }
+
+ public static void main(String[] args) {
+ new SampleBuild().start(args);
+ }
+
+ @Override
+ public void compile() throws Exception {
+ genver();
+ super.compile();
+ }
+
+ @BuildCommand(summary = "Generates version class")
+ public void genver() throws Exception {
+ new GeneratedVersionOperation()
+ .fromProject(this)
+// .classTemplate(new File(".", "myversion.txt"))
+ .execute();
+ }
+}
\ No newline at end of file
diff --git a/example/src/main/java/com/example/GeneratedVersion.java b/example/src/main/java/com/example/GeneratedVersion.java
new file mode 100644
index 0000000..90b566f
--- /dev/null
+++ b/example/src/main/java/com/example/GeneratedVersion.java
@@ -0,0 +1,17 @@
+package com.example;
+
+import java.util.Date;
+
+public final class GeneratedVersion {
+ public static final String PROJECT = "Sample";
+ public static final Date BUILD_DATE = new Date(1682700481013L);
+ public static final int MAJOR = 1;
+ public static final int MINOR = 0;
+ public static final int REVISION = 1;
+ public static final String QUALIFIER = "rc1";
+ public static final String VERSION = "1.0.1-rc1";
+
+ private GeneratedVersion() {
+ throw new UnsupportedOperationException("Illegal constructor call.");
+ }
+}
\ No newline at end of file
diff --git a/example/src/main/java/com/example/SampleMain.java b/example/src/main/java/com/example/SampleMain.java
new file mode 100644
index 0000000..cf7f5aa
--- /dev/null
+++ b/example/src/main/java/com/example/SampleMain.java
@@ -0,0 +1,22 @@
+package com.example;
+
+import java.text.SimpleDateFormat;
+import java.util.Locale;
+
+public class SampleMain {
+ public static void main(String[] args) {
+ final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z", Locale.US);
+
+ System.out.println("-----------------------------------------------------");
+
+ System.out.println(" Version: " + GeneratedVersion.PROJECT + ' ' + GeneratedVersion.VERSION);
+
+ System.out.println(" Built on: " + sdf.format(GeneratedVersion.BUILD_DATE));
+ System.out.println(" Major: " + GeneratedVersion.MAJOR);
+ System.out.println(" Minor: " + GeneratedVersion.MINOR);
+ System.out.println(" Revision: " + GeneratedVersion.REVISION);
+ System.out.println(" Qualifier:: " + GeneratedVersion.QUALIFIER);
+
+ System.out.println("-----------------------------------------------------");
+ }
+}
\ No newline at end of file