Initial commit
This commit is contained in:
commit
387d1a93e7
52 changed files with 1917 additions and 0 deletions
55
examples/.gitignore
vendored
Normal file
55
examples/.gitignore
vendored
Normal file
|
@ -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
|
3
examples/.idea/.gitignore
generated
vendored
Normal file
3
examples/.idea/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
examples/.idea/.name
generated
Normal file
1
examples/.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
|||
bld-property-file-examples
|
28
examples/.idea/app.iml
generated
Normal file
28
examples/.idea/app.iml
generated
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<output url="file://$MODULE_DIR$/build/main" />
|
||||
<output-test url="file://$MODULE_DIR$/build/test" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/main/resources/templates" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library" scope="RUNTIME">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="file://$MODULE_DIR$/src/main/resources/templates" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="compile" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="runtime" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="test" level="project" />
|
||||
</component>
|
||||
</module>
|
14
examples/.idea/bld.iml
generated
Normal file
14
examples/.idea/bld.iml
generated
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<output url="file://$MODULE_DIR$/build/bld" />
|
||||
<output-test url="file://$MODULE_DIR$/build/bld" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/src/bld">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/bld/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="bld" level="project" />
|
||||
</component>
|
||||
</module>
|
8
examples/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
examples/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="created" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
17
examples/.idea/libraries/bld.xml
generated
Normal file
17
examples/.idea/libraries/bld.xml
generated
Normal file
|
@ -0,0 +1,17 @@
|
|||
<component name="libraryTable">
|
||||
<library name="bld">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.rife2/dist/rife2-1.5.11.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.rife2/dist/rife2-1.5.11-sources.jar!/" />
|
||||
</SOURCES>
|
||||
<excluded>
|
||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||
</excluded>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
13
examples/.idea/libraries/compile.xml
generated
Normal file
13
examples/.idea/libraries/compile.xml
generated
Normal file
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="compile">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
13
examples/.idea/libraries/runtime.xml
generated
Normal file
13
examples/.idea/libraries/runtime.xml
generated
Normal file
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="runtime">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
13
examples/.idea/libraries/test.xml
generated
Normal file
13
examples/.idea/libraries/test.xml
generated
Normal file
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="test">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
9
examples/.idea/misc.xml
generated
Normal file
9
examples/.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PDMPlugin">
|
||||
<option name="skipTestSources" value="false" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build" />
|
||||
</component>
|
||||
</project>
|
9
examples/.idea/modules.xml
generated
Normal file
9
examples/.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/bld.iml" filepath="$PROJECT_DIR$/.idea/bld.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
9
examples/.idea/runConfigurations/Run Main.xml
generated
Normal file
9
examples/.idea/runConfigurations/Run Main.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Main" type="Application" factoryName="Application" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.example.PropertyFileExampleMain" />
|
||||
<module name="app" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
13
examples/.idea/runConfigurations/Run Tests.xml
generated
Normal file
13
examples/.idea/runConfigurations/Run Tests.xml
generated
Normal file
|
@ -0,0 +1,13 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Tests" type="JUnit" factoryName="JUnit">
|
||||
<module name="app" />
|
||||
<option name="PACKAGE_NAME" value="moog" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.example" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="directory" />
|
||||
<dir value="$PROJECT_DIR$/src/test/java" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
24
examples/.vscode/launch.json
vendored
Normal file
24
examples/.vscode/launch.json
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Run Main",
|
||||
"request": "launch",
|
||||
"mainClass": "com.example.PropertyFileExampleMain"
|
||||
},
|
||||
{
|
||||
"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"]
|
||||
}
|
||||
]
|
||||
}
|
15
examples/.vscode/settings.json
vendored
Normal file
15
examples/.vscode/settings.json
vendored
Normal file
|
@ -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.5.11.jar",
|
||||
"lib/compile/*.jar",
|
||||
"lib/runtime/*.jar",
|
||||
"lib/test/*.jar"
|
||||
]
|
||||
}
|
2
examples/bld
Executable file
2
examples/bld
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env sh
|
||||
java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build com.example.PropertyFileExampleBuild "$@"
|
4
examples/bld.bat
Normal file
4
examples/bld.bat
Normal file
|
@ -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.PropertyFileExampleBuild %*
|
BIN
examples/lib/bld/bld-wrapper.jar
Normal file
BIN
examples/lib/bld/bld-wrapper.jar
Normal file
Binary file not shown.
7
examples/lib/bld/bld-wrapper.properties
Normal file
7
examples/lib/bld/bld-wrapper.properties
Normal file
|
@ -0,0 +1,7 @@
|
|||
#Sun Apr 02 10:32:44 PDT 2023
|
||||
bld.extension=com.uwyn.rife2:bld-property-file:0.9.0
|
||||
bld.repositories=https\://repo1.maven.org/maven2/,/home/erik/.m2/repository
|
||||
rife2.downloadLocation=
|
||||
rife2.version=1.5.11
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.example;
|
||||
|
||||
import rife.bld.BuildCommand;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.extension.propertyFile.Entry;
|
||||
import rife.bld.extension.propertyFile.Entry.Operations;
|
||||
import rife.bld.extension.propertyFile.Entry.Types;
|
||||
import rife.bld.extension.propertyFile.PropertyFileOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||
import static rife.bld.dependencies.Repository.SONATYPE_SNAPSHOTS;
|
||||
import static rife.bld.dependencies.Scope.test;
|
||||
|
||||
public class PropertyFileExampleBuild extends Project {
|
||||
|
||||
public PropertyFileExampleBuild() {
|
||||
pkg = "com.example";
|
||||
name = "PropertyFileExample";
|
||||
mainClass = "com.example.PropertyFileExampleMain";
|
||||
version = version(0, 1, 0);
|
||||
|
||||
downloadSources = true;
|
||||
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
|
||||
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 PropertyFileExampleBuild().start(args);
|
||||
}
|
||||
|
||||
@BuildCommand
|
||||
public void updateMajor() throws Exception {
|
||||
new PropertyFileOperation(this)
|
||||
.file("version.properties")
|
||||
.entry(new Entry("version.major").defaultValue(1).type(Types.INT).operation(Operations.ADD))
|
||||
.entry(new Entry("version.minor").value(0))
|
||||
.entry(new Entry("version.patch").value(0))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@BuildCommand
|
||||
public void updateMinor() throws Exception {
|
||||
new PropertyFileOperation(this)
|
||||
.file("version.properties")
|
||||
.entry(new Entry("version.minor").defaultValue(0).type(Types.INT).operation(Operations.ADD))
|
||||
.entry(new Entry("version.patch").value(0))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@BuildCommand
|
||||
public void updatePatch() throws Exception {
|
||||
new PropertyFileOperation(this)
|
||||
.file("version.properties")
|
||||
.entry(new Entry("version.patch").defaultValue(0).type(Types.INT).operation(Operations.ADD))
|
||||
.execute();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.example;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
public class PropertyFileExampleMain {
|
||||
public static void main(String[] args) throws IOException {
|
||||
final Path path = Paths.get("version.properties");
|
||||
if (Files.exists(path)) {
|
||||
final List<String> content = Files.readAllLines(path);
|
||||
System.out.println("> cat " + path.getFileName());
|
||||
for (final String line : content) {
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return "Hello World!";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.example;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class PropertyFileExampleTest {
|
||||
@Test
|
||||
void verifyHello() {
|
||||
assertEquals("Hello World!", new PropertyFileExampleMain().getMessage());
|
||||
}
|
||||
}
|
5
examples/version.properties
Normal file
5
examples/version.properties
Normal file
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
#Sun Apr 02 15:20:15 PDT 2023
|
||||
version.major=3
|
||||
version.minor=0
|
||||
version.patch=0
|
Loading…
Add table
Add a link
Reference in a new issue