Compare commits

..

156 commits

Author SHA1 Message Date
7440631325 Fixed typo. 2020-11-10 11:40:22 -08:00
65a38facda Added workaround "unspecified" version. Closes #9 2020-11-10 11:03:48 -08:00
3e70a53714 Updated CI configurations. 2020-11-10 11:00:15 -08:00
afe6d3ebc9 Updated dependencies. 2020-11-10 10:59:45 -08:00
34cedc21e6 locked.properties now created in user.home (NTFS/FAT32 workaround) 2020-07-20 06:27:21 -07:00
e71f4f60ee Updated dependencies. 2020-07-20 06:09:35 -07:00
68f42777af Updated dependencies and copyright. 2020-03-17 14:57:22 -07:00
1f7861e314 Made versions an extra object. 2019-07-30 15:45:26 -07:00
765c07a85e Removed Java 12 syntax. 2019-07-28 21:38:10 -07:00
bf51d1d826 Updated compiler option syntax. 2019-07-27 14:10:16 -07:00
9737f66f64 Updated Java 12 syntax. 2019-07-26 15:56:36 -07:00
d17afba52e Added assertion failure messages. 2019-07-26 15:11:45 -07:00
c32a7ebdec Version 1.0.4. Closes #8 via e1891c47af 2019-07-26 13:08:14 -07:00
062758a5f0 New baseline. 2019-07-26 12:27:35 -07:00
860d985059 Added extension properties test. 2019-07-26 12:27:06 -07:00
c678bb7889 Improved version parsing. 2019-07-26 12:26:34 -07:00
c16f95a8d3 Testing extension properties. 2019-07-25 10:03:06 -07:00
6d23cead06 Changed to trusty dist. 2019-07-25 02:02:14 -07:00
24b12f131e Improved semver parsing. 2019-07-25 01:51:59 -07:00
e1891c47af Added version extension properties. 2019-07-25 01:51:40 -07:00
17b5ceaaf6 Updated dependencies. 2019-07-25 01:46:05 -07:00
ebc5b66fac Gradle 5.5.1 update. 2019-07-24 21:52:14 -07:00
7a1ff7ee24 Added JDK 12 processor argument configuration. 2019-05-26 23:49:02 -07:00
d45e700b6b Changed compileOnly to implementation. 2019-05-25 15:04:17 -07:00
b9c865bc6f Updated changelog. 2019-05-24 09:59:27 -07:00
51dbfe9c4e Version 1.0.2 2019-05-24 09:54:01 -07:00
a1054cf46a Updated examples. 2019-05-24 09:53:00 -07:00
fa23243ff5 Closes #6
Impletemented Gradle project directory-aware getPropertiesFile() function for all loading/saving.
2019-05-24 09:52:34 -07:00
ffda5e3ad4 Updated changelog. 2019-05-24 01:39:51 -07:00
4efc2ba2d6 Updated the examples. 2019-05-24 01:13:41 -07:00
6081bdfdd5 Added the Gradle project directory as the configuration properties file location. Closes #6 2019-05-24 01:03:30 -07:00
e47f762a6f 1.1.3 2019-04-23 17:14:01 -07:00
617c0b89ac Updated examples for 1.0.0. 2019-04-23 17:13:28 -07:00
6634ab3baf Added changelog. 2019-04-23 13:37:16 -07:00
2d2e8a2aca Pre-1.0.0 release cleanup. 2019-04-23 12:05:29 -07:00
a6b5cd6420 Cleanup 2019-04-19 00:09:52 -07:00
a729d3a87c Ensured only positive int in major, minor and patch. 2019-04-19 00:09:03 -07:00
338899e317 Cleanup. 2019-04-19 00:07:54 -07:00
c7bf4e21cc Version 1.0.1 2019-04-16 11:57:58 -07:00
2438d5c3d7 Updated wrappers and dependencies. 2019-04-16 11:53:18 -07:00
51fba9b362 Updated copyright. 2019-04-16 11:52:00 -07:00
7649039342 Added gradle.properties 2019-04-16 11:51:37 -07:00
a6b9eeea1d Cleanup. 2019-04-15 23:38:28 -07:00
28ca769c54 Cleanup. 2019-04-15 23:36:53 -07:00
2d8b0d5a62 Version 1.1.1 2019-04-15 23:36:38 -07:00
Ronald van Eede
da087f19db Extended existing tests to include semver property (#5) 2019-04-15 00:29:07 -07:00
5043868fc7 Cleanup. 2019-04-14 15:47:47 -07:00
27c3657f0f Handle empty input. 2019-04-14 15:47:25 -07:00
9d996cccac Added semver command line option. 2019-04-14 00:34:44 -07:00
b9ead8272e Improvements to the version parsing. 2019-04-14 00:34:11 -07:00
e760e8fb77 Whitepaces cleanup 2019-04-13 04:59:47 -07:00
ad5c3fa233 Updated baseline. 2019-04-13 04:46:14 -07:00
7c45ed087f Switched to gherkin syntax. 2019-04-13 04:45:50 -07:00
239a952d89 Implemented parsing of semver. 2019-04-13 04:43:40 -07:00
8510e80094 Test with semverKey. 2019-04-11 10:21:46 -07:00
963966eb1c Addded the ability to specify the semver property key. 2019-04-11 10:14:36 -07:00
1b12eba58b Closes #3 2019-04-11 10:13:58 -07:00
Ronald van Eede
e2c01103a7 Include full semver version in version.properties (#4) 2019-04-11 08:03:12 -07:00
ad2a7ae786 Reworked how the version properties file is read/written to better handle command line options, tests, etc. 2019-04-11 07:30:11 -07:00
6f4d3c1501 Updated dependencies and added buildScan support. 2019-04-11 00:32:14 -07:00
9985de1e0a Fixed test. 2019-04-10 22:38:34 -07:00
d3ebf2689e Reworked hasEnv to isNotSystemProperty. 2019-04-10 22:28:18 -07:00
e17feafd90 Added command line info. 2019-04-10 14:13:32 -07:00
8b0108ba96 Added tests for Utils class. 2019-04-10 14:13:13 -07:00
7bf291ac26 Added Utils class. 2019-04-10 14:12:56 -07:00
16d1a06571 Added the ability to specify the version via the command line. 2019-04-10 10:42:39 -07:00
8d423a506a Added version. 2019-04-10 10:41:36 -07:00
0929d9f5a1 Added copyright. Fixed typos. 2019-04-06 11:48:48 -07:00
d4fe2807d3 Forgot to commit. 2019-04-06 04:04:35 -07:00
f18ac5976f Moved to spek2. 2019-04-06 03:36:49 -07:00
23b3a4f204 Version 1.0.1 2019-04-06 03:36:18 -07:00
7152d9f899 Added versions. 2019-04-05 23:49:04 -07:00
87ddaec8b8 Updated examples. 2019-04-05 23:12:33 -07:00
e2f55f33e2 Added update wrappers and preflight check shell scripts. 2019-04-05 18:33:08 -07:00
76ffc77ada Added Travis CI and sonarcloud badges. 2019-04-04 10:14:35 -07:00
573b064a68 Added travis configuration. 2019-04-04 10:03:46 -07:00
d9da5d5bd0 Added more test. 2019-04-04 10:03:12 -07:00
04de55bac9 Added sonarcloud intergration. 2019-04-03 23:32:27 -07:00
c1f6360ec9 Ignore .history 2019-04-01 23:21:49 -07:00
db5c3c6f47 Use ./gradlew to test examples. 2019-04-01 23:20:26 -07:00
8ece30494d Cleanup. 2019-04-01 13:45:07 -07:00
1227746981 Fixed and added more tests. 2019-04-01 13:23:03 -07:00
b3d12d36a2 Added Gradle badge. 2019-03-31 16:39:33 -07:00
fe6503fffc Added name to boolen parameters. 2019-03-31 14:16:05 -07:00
b590486ffd assertEquals instead of assertTrue. 2019-03-31 14:15:35 -07:00
c3675e848d IDEA 2019.1 update. 2019-03-31 14:13:31 -07:00
bf1e1494bc Updated copyright. 2019-03-31 10:44:08 -07:00
fc926f9593 Fixed example link. 2019-03-30 22:50:25 -07:00
ada26af81b Updated build metadata description. 2019-03-30 22:46:07 -07:00
100efc71fe Updated dependencies. 2019-03-30 22:45:05 -07:00
74d2cfec11 Updated wrappers. 2019-03-30 22:44:05 -07:00
47d3c990bc Version 0.9.9-beta 2018-12-20 14:47:00 -08:00
2baf69cd32 Added check for required version properties.
Removed savedAfterProjectEvaluate option (no longer needed)
2018-12-20 13:05:51 -08:00
a0ddcae5f0
Merge pull request #2 from lewismorgan/props-updates
Add option for disabling saves every project evaluation
2018-12-20 11:46:49 -08:00
ebc945badc Dependencies and syntax updates. 2018-12-20 11:44:41 -08:00
Lewis
53910122f4 Add option for disabling saves every project evaluation
Caveat: If the properties file does not yet exist, this setting is ignored so it can be created
2018-12-19 19:01:55 -05:00
2cbea71c6f Fixed cache checksum. 2018-11-27 19:34:42 -08:00
4e72bd6c5a Cleanup. 2018-11-27 19:32:06 -08:00
008c4b7eb3 Gradle 5.0 and dependencies updates. 2018-11-27 19:19:53 -08:00
03cc2d5351 Updated deps. 2018-11-03 20:17:01 -07:00
ab85a04113 Kotlin-dsl syntax updates. 2018-11-01 19:07:17 -07:00
3485d314e0 Updated Gradle wrappers. 2018-11-01 19:06:00 -07:00
be383c3cde Updated Gradle wrapper. 2018-10-31 20:58:00 -07:00
ea643113c4 Updated dependencies. 2018-10-31 20:37:04 -07:00
d1be138400 Version 0.9.8-beta 2018-07-13 23:55:56 -07:00
1bf7b7c86e Fix properties loading on store. 2018-07-13 23:48:02 -07:00
d5dd895e47 Added increment build meta command line example. 2018-07-13 16:29:03 -07:00
421198a590 Fixed description 2018-07-13 16:28:41 -07:00
67ee3cad55 Added examples links for increment build meta task. 2018-07-13 16:24:10 -07:00
56593230ac Version 0.9.7-beta 2018-07-13 16:03:30 -07:00
a4e47cef0b Added increment build metadata task. 2018-07-13 15:19:05 -07:00
edae9cc660 Fixed eof newline per klintTestCheck. 2018-07-11 23:03:02 -07:00
1d4475c3de chmod +x 2018-07-11 22:56:00 -07:00
c85749f754 Added detekt baseline. 2018-07-11 22:55:18 -07:00
6415eb5d16 Added editorConfig. 2018-07-11 22:54:55 -07:00
281c6388ca Reimplemented SortedProperty with fix for Java > 8. 2018-07-11 22:54:30 -07:00
240c032dc9 IDEA settings update. 2018-07-11 03:43:20 -07:00
8007ba395c Added detekt plugin. 2018-07-11 03:42:27 -07:00
e378d47946 Now using reader and writer to access the properties file. 2018-07-11 03:41:37 -07:00
5b8a298a2b Added check for Gradle version. 2018-07-11 03:40:03 -07:00
0c62bba423 Removed sorted properties, not compatbile with Java > 8. 2018-07-10 23:52:26 -07:00
32931bcfa4 Version 0.9.6-beta 2018-07-10 00:43:48 -07:00
29c6fe9132 Added sorted properties. (Test) 2018-07-10 00:33:25 -07:00
b96c5d481b Fixed test. 2018-07-08 19:04:16 -07:00
762ff8553f Cleaned examples. 2018-07-07 18:31:20 -07:00
ff77b4e0b6 Added script to run all examples. 2018-07-07 18:30:57 -07:00
2f96e48186 Added version to info log. 2018-07-07 18:30:22 -07:00
d3f7203011 Version 0.9.5-beta 2018-07-07 11:05:19 -07:00
07b73fb5e1 Added vcs. 2018-07-07 11:04:58 -07:00
b50f2bad9a Updated example to cat the version properties file. 2018-07-07 01:40:16 -07:00
abe1ca269c Ignore *.class in source. 2018-07-03 21:24:47 -07:00
301a6afb0e Removed examples project from IDEA. 2018-07-03 19:32:31 -07:00
f4f0ce42ae More examples testing. 2018-07-03 19:25:40 -07:00
c7d46bfd7a Added more debug info. 2018-07-03 19:23:12 -07:00
689e5d6a6e Fixed missing version.patch in example. 2018-07-03 14:26:24 -07:00
17f2d1ad80 Fixed examples for IDEA. 2018-07-03 14:01:36 -07:00
964ddf5168 Syntax fix. 2018-07-03 14:01:09 -07:00
53bd8d7476 Added file absolute path to logger.info messages. 2018-07-03 14:00:12 -07:00
989733422d Made cacheable. 2018-07-03 13:58:56 -07:00
a0e3bcd893 Added test to make sure the default properties is version.properties. 2018-07-02 23:52:14 -07:00
642066b7ea Fixed klinkCheck errors. 2018-07-02 23:51:45 -07:00
a112b73d53 Version 0.9.4-beta. 2018-07-02 23:21:31 -07:00
7417ecb9f7 Added VSC workspace. 2018-07-02 23:12:50 -07:00
5561a7dfa0 IDEA properties updates, etc. 2018-07-02 23:12:25 -07:00
81cefb1f32 Fixed typo. 2018-07-02 23:10:14 -07:00
acbd394d2d Added default constructor to increment task. 2018-07-02 23:10:03 -07:00
d1bdd82353 Added more tasks for all examples. 2018-07-02 16:23:50 -07:00
e626476fab Changed examples to point to published plugin. 2018-07-02 12:38:50 -07:00
4232328cd6 Vesion 0.9.3-beta 2018-07-02 10:57:57 -07:00
6edee47f22 Simplified useTestNG declaration. 2018-07-02 00:01:13 -07:00
89de884e34 Cleanup. 2018-07-02 00:00:06 -07:00
474263452f Added examples. 2018-07-01 21:50:49 -07:00
877e4bd622 Reformat. 2018-07-01 21:49:54 -07:00
483d639dfb Project version is now set on start. 2018-07-01 21:49:11 -07:00
62182b489b Fix prefix on default properties file. 2018-07-01 21:47:50 -07:00
691580baec Reformat. 2018-07-01 21:47:19 -07:00
148 changed files with 4778 additions and 888 deletions

View file

@ -1,3 +1,4 @@
version: 2
defaults: &defaults
working_directory: ~/repo
docker:
@ -5,8 +6,7 @@ defaults: &defaults
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
version: 2.0
CI: true
jobs:
build_gradle:
@ -16,7 +16,7 @@ jobs:
- checkout
- restore_cache:
keys:
- gradle-dependencies-{{ checksum "build.gradle" }}
- gradle-dependencies-{{ checksum "build.gradle.kts" }}
# fallback to using the latest cache if no exact match is found
- gradle-dependencies-
@ -25,12 +25,12 @@ jobs:
command: ./gradlew dependencies
- save_cache:
paths: ~/.m2
key: gradle-dependencies-{{ checksum "build.gradle" }}
paths: ~/.gradle
key: gradle-dependencies-{{ checksum "build.gradle.kts" }}
- run:
name: Run All Checks
command: ./gradlew check
command: ./gradlew check --scan
- store_artifacts:
path: build/reports/
@ -40,6 +40,6 @@ jobs:
workflows:
version: 2
build_gradle_and_kobalt:
build_gradle:
jobs:
- build_gradle

2
.editorconfig Normal file
View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

19
.github/workflows/gradle.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Java CI with Gradle
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew check

93
.gitignore vendored
View file

@ -1,29 +1,84 @@
**/.idea/dictionaries
**/.idea/gradle.xml
**/.idea/libraries
**/.idea/tasks.xml
**/.idea/workspace.xml
*.sublime-*
*.iws
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
__pycache__
.classpath
.DS_Store
.gradle
.history
.kobalt
.mtj.tmp/
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.nb-gradle
.project
.scannerwork
.settings
/bin
/build
/deploy
/dist
/gen
/gradle.properties
/local.properties
/out
/proguard-project.txt
/project.properties
/target
/test-output
*.class
*.code-workspace
*.ctxt
*.iws
*.log
*.nar
*.rar
*.sublime-*
*.tar.gz
*.zip
/**/.idea_modules/
/**/.idea/**/caches/build_file_checksums.ser
/**/.idea/**/contentModel.xml
/**/.idea/**/dataSources.ids
/**/.idea/**/dataSources.local.xml
/**/.idea/**/dataSources/
/**/.idea/**/dbnavigator.xml
/**/.idea/**/dictionaries
/**/.idea/**/dynamic.xml
/**/.idea/**/gradle.xml
/**/.idea/**/httpRequests
/**/.idea/**/libraries
/**/.idea/**/mongoSettings.xml
/**/.idea/**/replstate.xml
/**/.idea/**/shelf
/**/.idea/**/shelf/
/**/.idea/**/sqlDataSources.xml
/**/.idea/**/tasks.xml
/**/.idea/**/uiDesigner.xml
/**/.idea/**/usage.statistics.xml
/**/.idea/**/workspace.xml
/**/.idea/$CACHE_FILE$
/**/.idea/$PRODUCT_WORKSPACE_FILE$
atlassian-ide-plugin.xml
bin/
build/
cmake-build-*/
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
dependency-reduced-pom.xml
deploy/
dist/
ehthumbs.db
fabric.properties
gen/
gradle.properties
hs_err_pid*
kobaltBuild
kobaltw*-test
lib/kotlin*
libs/
local.properties
out/
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
proguard-project.txt
project.properties
release.properties
target/
test-output
Thumbs.db
venv

31
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,31 @@
image: gradle:alpine
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages:
- build
- test
build:
stage: build
script: ./gradlew --build-cache assemble
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
test:
stage: test
script: ./gradlew check
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle

1
.idea/.name generated
View file

@ -1 +0,0 @@
semver

16
.idea/checkstyle-idea.xml generated Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.19" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>

11
.idea/compiler.xml generated
View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="semver-gradle_main" target="1.10" />
<module name="semver-gradle_test" target="1.10" />
<module name="semver_main" target="1.10" />
<module name="semver_test" target="1.10" />
</bytecodeTargetLevel>
</component>
</project>

View file

@ -1,6 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) &amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="allowReplaceRegexp" value="Copyright" />
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) 2018-&amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="myName" value="Erik's Copyright Notice" />
</copyright>
</component>

View file

@ -1,8 +1,7 @@
<component name="CopyrightManager">
<settings default="Erik's Copyright Notice">
<LanguageOptions name="Kotlin">
<option name="fileTypeOverride" value="3" />
<option name="addBlankAfter" value="false" />
</LanguageOptions>
<module2copyright>
<element module="Copyright" copyright="Erik's Copyright Notice" />
</module2copyright>
</settings>
</component>

30
.idea/jarRepositories.xml generated Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:/$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
</remote-repository>
</component>
</project>

7
.idea/kotlinc.xml generated
View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JsCompilerArguments">
<option name="sourceMapEmbedSources" />
<option name="sourceMapPrefix" />
</component>
</project>

17
.idea/misc.xml generated
View file

@ -1,6 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$/examples/annotation-processor/java" />
<file type="web" url="file://$PROJECT_DIR$/examples/annotation-processor/kotlin" />
<file type="web" url="file://$PROJECT_DIR$/examples/java" />
<file type="web" url="file://$PROJECT_DIR$/examples/kotlin" />
</component>
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

4
.idea/modules.xml generated
View file

@ -2,9 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/semver.iml" filepath="$PROJECT_DIR$/.idea/modules/semver.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/semver_main.iml" filepath="$PROJECT_DIR$/.idea/modules/semver_main.iml" group="semver" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/semver_test.iml" filepath="$PROJECT_DIR$/.idea/modules/semver_test.iml" group="semver" />
<module fileurl="file://$PROJECT_DIR$/.idea/semver-gradle.iml" filepath="$PROJECT_DIR$/.idea/semver-gradle.iml" />
</modules>
</component>
</project>

View file

@ -1,216 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="semver:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="net.thauvin.erik.gradle" external.system.module.type="sourceSet" external.system.module.version="0.9.1-beta" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.8" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/main" />
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
<option name="moduleName" value="semver" />
<option name="jvmTarget" value="1.8" />
<option name="addCompilerBuiltIns" value="true" />
<option name="loadBuiltInsFromDependencies" value="true" />
<option name="languageVersion" value="1.2" />
<option name="apiVersion" value="1.2" />
<option name="pluginOptions">
<array>
<option value="plugin:org.jetbrains.kotlin.samWithReceiver:annotation=org.gradle.api.HasImplicitReceiver" />
</array>
</option>
<option name="pluginClasspaths">
<array>
<option value="$KOTLIN_BUNDLED$/lib/sam-with-receiver-compiler-plugin.jar" />
</array>
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_10">
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/kotlin" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-reflect-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-kotlin-dsl-extensions-0.17.5-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-tooling-models-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/groovy-all-2.4.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-api-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-provider-spi-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk8-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-installation-beacon-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk7-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-kotlin-dsl-extensions-0.17.5-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-tooling-models-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.41" level="project" />
<orderEntry type="module-library" scope="PROVIDED">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-provider-spi-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.41" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-reflect:1.2.41" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.41" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-reflect-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk7-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk8-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View file

@ -1,245 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="semver:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="net.thauvin.erik.gradle" external.system.module.type="sourceSet" external.system.module.version="0.9.1-beta" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.8" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/test" />
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
<option name="moduleName" value="semver" />
<option name="jvmTarget" value="1.8" />
<option name="addCompilerBuiltIns" value="true" />
<option name="loadBuiltInsFromDependencies" value="true" />
<option name="languageVersion" value="1.2" />
<option name="apiVersion" value="1.2" />
<option name="pluginOptions">
<array>
<option value="plugin:org.jetbrains.kotlin.samWithReceiver:annotation=org.gradle.api.HasImplicitReceiver" />
</array>
</option>
<option name="pluginClasspaths">
<array>
<option value="$KOTLIN_BUNDLED$/lib/sam-with-receiver-compiler-plugin.jar" />
</array>
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_10">
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/kotlin" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk8-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-api-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://C:/gradle/src/announce" />
<root url="file://C:/gradle/src/antlr" />
<root url="file://C:/gradle/src/base-services" />
<root url="file://C:/gradle/src/base-services-groovy" />
<root url="file://C:/gradle/src/build-cache" />
<root url="file://C:/gradle/src/build-cache-http" />
<root url="file://C:/gradle/src/build-comparison" />
<root url="file://C:/gradle/src/build-init" />
<root url="file://C:/gradle/src/build-option" />
<root url="file://C:/gradle/src/cli" />
<root url="file://C:/gradle/src/code-quality" />
<root url="file://C:/gradle/src/composite-builds" />
<root url="file://C:/gradle/src/core" />
<root url="file://C:/gradle/src/core-api" />
<root url="file://C:/gradle/src/dependency-management" />
<root url="file://C:/gradle/src/diagnostics" />
<root url="file://C:/gradle/src/ear" />
<root url="file://C:/gradle/src/ide" />
<root url="file://C:/gradle/src/ide-native" />
<root url="file://C:/gradle/src/ide-play" />
<root url="file://C:/gradle/src/installation-beacon" />
<root url="file://C:/gradle/src/internal-android-performance-testing" />
<root url="file://C:/gradle/src/internal-integ-testing" />
<root url="file://C:/gradle/src/internal-performance-testing" />
<root url="file://C:/gradle/src/internal-testing" />
<root url="file://C:/gradle/src/ivy" />
<root url="file://C:/gradle/src/jacoco" />
<root url="file://C:/gradle/src/javascript" />
<root url="file://C:/gradle/src/jvm-services" />
<root url="file://C:/gradle/src/language-groovy" />
<root url="file://C:/gradle/src/language-java" />
<root url="file://C:/gradle/src/language-jvm" />
<root url="file://C:/gradle/src/language-native" />
<root url="file://C:/gradle/src/language-scala" />
<root url="file://C:/gradle/src/launcher" />
<root url="file://C:/gradle/src/logging" />
<root url="file://C:/gradle/src/maven" />
<root url="file://C:/gradle/src/messaging" />
<root url="file://C:/gradle/src/model-core" />
<root url="file://C:/gradle/src/model-groovy" />
<root url="file://C:/gradle/src/native" />
<root url="file://C:/gradle/src/osgi" />
<root url="file://C:/gradle/src/persistent-cache" />
<root url="file://C:/gradle/src/platform-base" />
<root url="file://C:/gradle/src/platform-jvm" />
<root url="file://C:/gradle/src/platform-native" />
<root url="file://C:/gradle/src/platform-play" />
<root url="file://C:/gradle/src/plugin-development" />
<root url="file://C:/gradle/src/plugin-use" />
<root url="file://C:/gradle/src/plugins" />
<root url="file://C:/gradle/src/process-services" />
<root url="file://C:/gradle/src/publish" />
<root url="file://C:/gradle/src/reporting" />
<root url="file://C:/gradle/src/resources" />
<root url="file://C:/gradle/src/resources-gcs" />
<root url="file://C:/gradle/src/resources-http" />
<root url="file://C:/gradle/src/resources-s3" />
<root url="file://C:/gradle/src/resources-sftp" />
<root url="file://C:/gradle/src/scala" />
<root url="file://C:/gradle/src/signing" />
<root url="file://C:/gradle/src/test-kit" />
<root url="file://C:/gradle/src/testing-base" />
<root url="file://C:/gradle/src/testing-junit-platform" />
<root url="file://C:/gradle/src/testing-jvm" />
<root url="file://C:/gradle/src/testing-native" />
<root url="file://C:/gradle/src/tooling-api" />
<root url="file://C:/gradle/src/tooling-api-builders" />
<root url="file://C:/gradle/src/version-control" />
<root url="file://C:/gradle/src/workers" />
<root url="file://C:/gradle/src/wrapper" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-test-kit-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="semver_main" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-provider-spi-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/groovy-all-2.4.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-tooling-models-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-reflect-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/4.8.1/generated-gradle-jars/gradle-kotlin-dsl-extensions-0.17.5-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-jdk7-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-installation-beacon-4.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/gradle-kotlin-dsl-0.17.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-4.8.1-bin/e8p42vx1m7a3mz9ydmjagn6wn/gradle-4.8.1/lib/kotlin-stdlib-1.2.41.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-test:1.2.41" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.spek:spek-api:1.1.5" level="project" />
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/../../build/pluginUnderTestMetadata" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.41" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains.spek:spek-junit-platform-engine:1.1.5" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-test-common:1.2.41" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.platform:junit-platform-launcher:1.2.0" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.2.41" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.platform:junit-platform-engine:1.2.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.platform:junit-platform-commons:1.2.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.apiguardian:apiguardian-api:1.0.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.opentest4j:opentest4j:1.1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-reflect:1.2.41" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.41" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.41" level="project" />
</component>
<component name="TestModuleProperties" production-module="semver_main" />
</module>

3
.idea/scopes/Copyright.xml generated Normal file
View file

@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Copyright" pattern="file[semver-gradle]:src/main/kotlin/net/thauvin/erik/gradle/semver//*||file[semver-gradle]:src/test/kotlin/net/thauvin/erik/gradle/semver//*||file[examples-kotlin.main]:*/||file[examples-kotlin.test]:*/||file[examples-java.main]:*/||file[examples-java.test]:*/||file[ap-examples-kotlin.main]:*/||file[ap-examples-java.main]:*/" />
</component>

View file

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Sources" pattern="file[semver_main]:kotlin/net/thauvin/erik/gradle/semver//*||file[semver_test]:kotlin/net/thauvin/erik/gradle/semver//*" />
</component>

2
.idea/vcs.xml generated
View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

30
.travis.yml Normal file
View file

@ -0,0 +1,30 @@
language: java
dist: trusty
jdk:
- oraclejdk8
addons:
sonarcloud:
organization: "ethauvin-github"
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
before_install:
- chmod +x gradlew
script:
- ./gradlew check --scan
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
after_success:
- |
if [ "${TRAVIS_TEST_RESULT}" == 0 ]; then
./gradlew sonarqube
fi

68
CHANGELOG.md Normal file
View file

@ -0,0 +1,68 @@
# Change Log
## [1.0.4](https://github.com/ethauvin/semver-gradle/tree/1.0.4) (2019-07-26)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/1.0.3-beta...1.0.4)
**Implemented enhancements:**
- Access semver version properties in Gradle build file. [\#8](https://github.com/ethauvin/semver-gradle/issues/8)
## [1.0.3-beta](https://github.com/ethauvin/semver-gradle/tree/1.0.3-beta) (2019-07-25)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/1.0.2...1.0.3-beta)
**Closed issues:**
- Thanks! [\#7](https://github.com/ethauvin/semver-gradle/issues/7)
## [1.0.2](https://github.com/ethauvin/semver-gradle/tree/1.0.2) (2019-05-24)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/1.0.1...1.0.2)
**Implemented enhancements:**
- version.properties write issue when using NetBeans on Windows. [\#6](https://github.com/ethauvin/semver-gradle/issues/6)
## [1.0.1](https://github.com/ethauvin/semver-gradle/tree/1.0.1) (2019-05-24)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/1.0.0...1.0.1)
## [1.0.0](https://github.com/ethauvin/semver-gradle/tree/1.0.0) (2019-04-23)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.9-beta...1.0.0)
**Implemented enhancements:**
- Optionally save version properties [\#1](https://github.com/ethauvin/semver-gradle/issues/1)
- Set prerelease from commandline [\#3](https://github.com/ethauvin/semver-gradle/issues/3)
**Merged pull requests:**
- Extended existing tests to include semver property [\#5](https://github.com/ethauvin/semver-gradle/pull/5) ([rveede](https://github.com/rveede))
- Include full semver version in version.properties [\#4](https://github.com/ethauvin/semver-gradle/pull/4) ([rveede](https://github.com/rveede))
## [0.9.9-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.9-beta) (2018-12-20)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.8-beta...0.9.9-beta)
**Merged pull requests:**
- Add option for disabling saves every project evaluation [\#2](https://github.com/ethauvin/semver-gradle/pull/2) ([lewismorgan](https://github.com/lewismorgan))
## [0.9.8-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.8-beta) (2018-07-14)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.7-beta...0.9.8-beta)
## [0.9.7-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.7-beta) (2018-07-13)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.6-beta...0.9.7-beta)
## [0.9.6-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.6-beta) (2018-07-10)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.5-beta...0.9.6-beta)
## [0.9.5-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.5-beta) (2018-07-07)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.4-beta...0.9.5-beta)
## [0.9.4-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.4-beta) (2018-07-03)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.3-beta...0.9.4-beta)
## [0.9.3-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.3-beta) (2018-07-02)
[Full Changelog](https://github.com/ethauvin/semver-gradle/compare/0.9.2-beta...0.9.3-beta)
## [0.9.2-beta](https://github.com/ethauvin/semver-gradle/tree/0.9.2-beta) (2018-07-01)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

View file

@ -1,4 +1,4 @@
Copyright (c) 2018, Erik C. Thauvin (erik@thauvin.net)
Copyright (c) 2018-2020, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without

180
README.md
View file

@ -1,14 +1,14 @@
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![CircleCI](https://circleci.com/gh/ethauvin/semver-gradle/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver-gradle/tree/master)
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_semver-gradle&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_semver-gradle) [![Build Status](https://travis-ci.com/ethauvin/semver-gradle.svg?branch=master)](https://travis-ci.com/ethauvin/semver-gradle) [![CircleCI](https://circleci.com/gh/ethauvin/semver-gradle/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver-gradle/tree/master) [![Gradle](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/net/thauvin/erik/gradle/semver/maven-metadata.xml.svg?label=gradle&color=blue)](https://plugins.gradle.org/plugin/net.thauvin.erik.gradle.semver)
# Semantic Version Plugin for Gradle
A [Semantic Version](https://semver.org) Plugin for [Gradle](https://gradle.org) that manages a project version via a properties file, and provide tasks to __automatically increment__ major, minor and patch build numbers.
A [Semantic Version](https://semver.org) Plugin for [Gradle](https://gradle.org) that manages a project version via a properties file, and provide tasks to __automatically increment__ major, minor, patch and build version numbers.
The plugin can be used in conjunction with the [Semantic Version Annotation Processor](https://github.com/ethauvin/semver).
The plugin can be used in conjunction with the [__Semantic Version Annotation Processor__](https://github.com/ethauvin/semver).
## Using the plugin
The plugin is published to the Plugin Portal; see instructions there: [net.thauvin.erik.gradle.semver](https://plugins.gradle.org/plugin/net.thauvin.erik.gradle.semver)
The plugin is published to the Plugin Portal; see instructions there: [__net.thauvin.erik.gradle.semver__](https://plugins.gradle.org/plugin/net.thauvin.erik.gradle.semver)
## Version Properties File
@ -21,14 +21,19 @@ version.minor=0
version.patch=0
version.prerelease=
version.buildmeta=
version.semver=1.0.0
```
To change the version of your project, remove the version from your `build.gradle` and simply edit your the version properties file to match your version number.
To change the version of your project, remove the version from `build.gradle` and simply edit the version properties file to match your version number.
- __Examples__: [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/java), [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/kotlin)
If you need to change the properties file or name of the properties keys to match your own build environment. Please see the [Configuration](#configuration) section.
## Increment Version Tasks
### incrementMajor, incrementMinor and incrementPatch
The `incrementMajor`, `incrementMinor` and `incrementPatch` tasks are available to automatically increment their respective and reset lower counterpart version numbers.
- `incrementMajor` will increment the `major` and set the `minor` and `patch` versions to `0`.
@ -49,6 +54,81 @@ someTask {
}
```
- __Examples__: [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/java), [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/kotlin)
### incrementBuildMeta
The `incrementBuildMeta` task is available to set the build metadata version to a custom calculated value.
#### Examples:
To set the build metadata to a custom formatted date:
```gradle
incrementBuildMeta {
doFirst {
buildMeta = new Date().format("yyyyMMddHHmmss")
}
}
```
```bash
./gradlew incrementBuildMeta
...
> Task :incrementBuildMeta
Version: 1.0.16-beta+20180713143416
```
Or to set the build metadata to a custom formatted number with increment:
```gradle
incrementBuildMeta {
doFirst {
buildMeta = sprintf("%03d", (buildMeta as Integer) + 1)
}
}
```
```bash
./gradlew incrementBuildMeta
...
> Task :incrementBuildMeta
Version: 1.0.16-beta+002
```
- __Examples__: [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/java), [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/kotlin)
## Command Line
The `major`, `minor`, `patch`, `prerelease` and `buildmeta` versions can also be set via the command line:
```bash
./gradlew -Dversion.prerelease=beta -Dversion.buildmeta= ...
```
```ini
#version.properties
version.major=1
version.minor=0
version.patch=0
version.prerelease=beta
version.buildmeta=
version.semver=1.0.0-beta
```
The full semantic version can also be specified via the `semver` property:
```sh
./gradlew -Dversion.semver=1.0.0-beta ...
```
If a version cannot be parsed your build will **fail**.
## Configuration
### Version File Properties
@ -61,15 +141,17 @@ Property | Description | Default
`version.minor` | The minor version. | `0`
`version.patch` | The patch version. | `0`
`version.prerelease` | The pre-release version |
`version.buildmeta` | The build metatdata version |
`version.prerelease.prefix` | The pre-release prefix | `-`
`version.buildmeta` | The build metatdata version |
`version.buildmeta.prefix` | The build metadata prefix | `+`
`version.separator` | The version separator. | `.`
The version number is built as follows:
`version.major` `version.separtor` `version.minor` `version.separator` `[` `version.prerelease.prefix` `version.prerelease` `]` `[` `version.prerelease.prefix` `version.buildmeta` `]`
`version.major` `version.separator` `version.minor` `version.separator` `version.patch` `[` `version.prerelease.prefix` `version.prerelease` `]` `[` `version.prerelease.prefix` `version.buildmeta` `]`
For reference, it is automatically included in the `version.semver` property.
for example:
@ -80,11 +162,14 @@ version.minor=0
version.patch=0
version.prerelease=beta
version.buildmeta=exp.sha.5114f85
version.semver=1.0.0-beta+exp.sha.5114f85
```
`projet.version` will be `1.0.0-beta+exp.sha.5114f85` in Gradle.
`project.version` will be `1.0.0-beta+exp.sha.5114f85` in Gradle.
- __Examples__: [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/java), [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/kotlin)
### Semver
In a Gradle build file, the `semver` block is used to configure how the plugin will read/write the version properties file. In most cases it is not needed.
@ -102,6 +187,7 @@ or using different property keys for the version data:
```gradle
semver {
keysPrefix = "" // no prefix
semverKey = "version"
majorKey = "maj"
minorKey = "min"
patchKey = "build"
@ -118,21 +204,23 @@ min=0
build=0
rel=beta
meta=
version=1.0.0-beta
```
The following `semver` properties are available:
Property | Description | Default
:---------------------|:----------------------------------------|:------------------------
:---------------------|:----------------------------------------|:---------------------------
`properties` | The properties file. | `version.properties`
`majorKey` | The major property key. | `major`
`minorKey` | The minor property key. | `minor`
`patchKey` | The patch property key. | `patch`
`preReleaseKey` | The pre-release property key. | `preRelease`
`preReleasePrefixKey` | The build pre-release prefix key. | `preReleasePrefix`
`buildMetaKey` | The build metadata property key. | `buildMeta`
`buildMetaPrefixKey` | The build metadata prefix property key. | `buildMetaPrefix`
`separatorKey` | The separator property key. | `separator`
`semverKey` | The semver property key. | `version.semver`
`majorKey` | The major property key. | `version.major`
`minorKey` | The minor property key. | `version.minor`
`patchKey` | The patch property key. | `version.patch`
`preReleaseKey` | The pre-release property key. | `version.prerelease`
`preReleasePrefixKey` | The build pre-release prefix key. | `version.prerelease.prefix`
`buildMetaKey` | The build metadata property key. | `version.buildmeta`
`buildMetaPrefixKey` | The build metadata prefix property key. | `version.buildmeta.prefix`
`separatorKey` | The separator property key. | `version.separator`
`keysPrefix` | The prefix for all property keys. | `version.`
In order to quickly support multiple projects. The `keysPrefix` property is available to set all properties keys prefixes at once:
@ -151,8 +239,64 @@ test.minor=0
test.patch=0
test.prerelease=
test.buildmeta=
test.semver=1.0.0
```
- __Examples__: [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/java), [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/kotlin)
### Semver Extension Properties
The values stored in the version properties file can individually be accessed using the `semver` extension, for example:
```gradle
fooTask {
doFirst {
println "Build: $semver.buildMeta"
}
}
```
The semver extension properties are:
Property | Description
:-------------------------|:----------------------------
`semver.semver` | The full semantic version.
`semver.version` | Same as `semver.semver`.
`semver.major` | The major version.
`semver.minor` | The minor version.
`semver.patch` | The patch version.
`semver.preRelease` | The pre-release version
`semver.preReleasePrefix` | The pre-release prefix
`semver.buildMeta` | The build metatdata version
`semver.buildMetaPrefix` | The build metadata prefix
`semver.separator` | The version separator.
## Version is "unspecified"
This is a common problem stemming from the configuration and build phases in Gradle.
It is always preferable to access to version during the execution stage, in a `doFirst` or `doLast` closure within your tasks:
```gradle
task foo() {
doFirst {
println project.version
}
}
```
or if absolutely necessary, at the end of the configuration stage in a `project.afterEvaluate` block:
```gradle
foo {
project.afterEvaluate {
println project.version
}
}
```
## Source Code Generation
If you'd like to incorporate the version number data into your source code, please have a look at the [Semantic Version Annotation Processor](https://github.com/ethauvin/semver).
If you'd like to incorporate the version number data into your source code, please have a look at the [__Semantic Version Annotation Processor__](https://github.com/ethauvin/semver).
There are also full [examples](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor) in both [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/java) and [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/kotlin) showing how to use both the plugin and annotation processor concurrently.

9
bitbucket-pipelines.yml Normal file
View file

@ -0,0 +1,9 @@
image: openjdk:8
pipelines:
default:
- step:
caches:
- gradle
script:
- bash ./gradlew check

View file

@ -1,45 +1,44 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
id("com.gradle.plugin-publish") version "0.9.10"
id("com.github.ben-manes.versions") version "0.20.0"
id("org.jlleitschuh.gradle.ktlint") version "4.1.0"
jacoco
kotlin("jvm") version "1.3.72"
id("com.github.ben-manes.versions") version "0.36.0"
id("com.gradle.plugin-publish") version "0.12.0"
id("io.gitlab.arturbosch.detekt") version "1.14.2"
id("org.gradle.kotlin.kotlin-dsl") version "1.3.6"
id("org.sonarqube") version "3.0"
}
version = "0.9.2-beta"
version = "1.0.5-beta"
group = "net.thauvin.erik.gradle"
var github = "https://github.com/ethauvin/semver-gradle"
var packageName = "net.thauvin.erik.gradle.semver"
object VersionInfo {
const val spek = "2.0.13"
}
val versions: VersionInfo by extra { VersionInfo }
var spekVersion = "1.1.5"
val github = "https://github.com/ethauvin/semver-gradle"
val packageName = "net.thauvin.erik.gradle.semver"
repositories {
jcenter()
}
dependencies {
compile(gradleApi())
implementation(gradleApi())
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation(kotlin("stdlib"))
testImplementation(kotlin("reflect"))
testImplementation(kotlin("test"))
testImplementation(gradleTestKit())
testImplementation("org.jetbrains.spek:spek-api:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.jetbrains.spek:spek-junit-platform-engine:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.junit.platform")
}
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.2.0") {
because("Needed to run tests IDEs that bundle an older version")
}
testImplementation("org.spekframework.spek2:spek-dsl-jvm:${versions.spek}")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:${versions.spek}")
}
tasks {
@ -51,19 +50,42 @@ tasks {
withType<Test> {
useJUnitPlatform {
includeEngines("spek")
includeEngines("spek2")
}
}
val check by getting {
dependsOn("ktlintCheck")
withType<JacocoReport> {
reports {
html.isEnabled = true
xml.isEnabled = true
}
}
"sonarqube" {
dependsOn("jacocoTestReport")
}
}
detekt {
// input = files("src/main/kotlin", "src/test/kotlin")
// filters = ".*/resources/.*,.*/build/.*"
baseline = project.rootDir.resolve("detekt-baseline.xml")
}
sonarqube {
properties {
property("sonar.projectName", "semver-gradle")
property("sonar.projectKey", "ethauvin_semver-gradle")
property("sonar.sourceEncoding", "UTF-8")
}
}
gradlePlugin {
(plugins) {
project.name {
plugins {
create(project.name) {
id = packageName
displayName = "SemVer Plugin"
description = "Semantic Version Plugin for Gradle"
implementationClass = "$packageName.SemverPlugin"
}
}
@ -72,16 +94,7 @@ gradlePlugin {
pluginBundle {
website = github
vcsUrl = github
description = "Semantic Version Plugin for Gradle"
tags = listOf("semver", "semantic", "version", "versioning", "auto-increment", "kotlin", "java")
(plugins) {
project.name {
id = packageName
displayName = project.name
}
}
mavenCoordinates {
groupId = project.group.toString()
artifactId = project.name

12
detekt-baseline.xml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>MagicNumber:Utils.kt$Utils$3</ID>
<ID>MagicNumber:Utils.kt$Utils$4</ID>
<ID>MagicNumber:Utils.kt$Utils$5</ID>
<ID>NestedBlockDepth:Utils.kt$Utils$fun loadProperties(file: File): Properties</ID>
<ID>NestedBlockDepth:Utils.kt$Utils$fun parseSemVer(input: String?, version: Version): Boolean</ID>
<ID>NestedBlockDepth:Utils.kt$Utils$fun saveProperties(projectDir: File, config: SemverConfig, version: Version)</ID>
</CurrentIssues>
</SmellBaseline>

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

View file

@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# batch files are specific to windows and always crlf
*.bat eol=crlf

View file

@ -0,0 +1,82 @@
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
!gradle-wrapper.jar
.classpath
.DS_Store
.gradle
.history
.idea_modules/
.idea/**/contentModel.xml
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/dataSources/
.idea/**/dbnavigator.xml
.idea/**/dictionaries
.idea/**/dynamic.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/**/mongoSettings.xml
.idea/**/shelf
.idea/**/sqlDataSources.xml
.idea/**/tasks.xml
.idea/**/uiDesigner.xml
.idea/**/usage.statistics.xml
.idea/**/workspace.xml
.idea/caches/build_file_checksums.ser
.idea/httpRequests
.idea/replstate.xml
.kobalt
.mtj.tmp/
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.nb-gradle
.project
.scannerwork
.settings
.vscode/*
*.class
*.code-workspace
*.ctxt
*.ear
*.iws
*.jar
*.log
*.nar
*.rar
*.sublime-*
*.tar.gz
*.war
*.zip
atlassian-ide-plugin.xml
bin/
build/
cmake-build-*/
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
dependency-reduced-pom.xml
deploy/
dist/
ehthumbs.db
fabric.properties
gen/
gradle.properties
hs_err_pid*
kobaltBuild
kobaltw*-test
lib/kotlin*
libs/
local.properties
out/
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
proguard-project.txt
project.properties
release.properties
target/
test-output
Thumbs.db

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="ap-examples-java.main" target="12" />
<module name="ap-examples-java.test" target="12" />
</bytecodeTargetLevel>
</component>
</project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View file

@ -0,0 +1,53 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="false" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
</component>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-java.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-java.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-java.main.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-java.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-java.test.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-java.test.iml" />
</modules>
</component>
</project>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="semver" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="net.thauvin.erik.gradle" external.system.module.version="0.9.1-beta" type="JAVA_MODULE" version="4">
<module external.linked.project.id="ap-examples-java" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="2.1.2" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../..">

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="ap-examples-java:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="2.1.2" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/generated">
<sourceFolder url="file://$MODULE_DIR$/../../src/generated/java" isTestSource="false" generated="true" />
</content>
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.6" level="project" />
</component>
</module>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="ap-examples-java:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="2.1.2" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ap-examples-java.main" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.1.1" level="project" />
</component>
<component name="TestModuleProperties" production-module="ap-examples-java.main" />
</module>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,48 @@
plugins {
id 'java'
id 'application'
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
id 'com.github.ben-manes.versions' version '0.28.0'
}
// ./gradlew
// ./gradlew clean incrementPatch run
// ./gradlew clean incrementMinor run
// ./gradlew clean incrementMajor run
mainClassName = 'com.example.Example'
defaultTasks 'run'
def semverProcessor = "net.thauvin.erik:semver:1.2.0"
dependencies {
annotationProcessor semverProcessor
implementation semverProcessor
}
tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/src/generated/java")
options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
}
repositories {
mavenLocal()
jcenter()
}
run {
doFirst {
println "Version: $version"
}
// args = ['example.properties']
args = ['version.properties']
}
semver {
// properties = "example.properties"
// keysPrefix = "example."
// preReleaseKey = "release"
// buildMetaKey = "meta"
}

View file

@ -0,0 +1,7 @@
#Generated by the Semver Plugin for Gradle
#Thu Nov 01 18:52:23 PDT 2018
example.major=1
example.meta=
example.minor=0
example.patch=0
example.release=

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
examples/annotation-processor/java/gradlew vendored Executable file
View file

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

View file

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html
*/
rootProject.name = 'ap-examples-java'

View file

@ -0,0 +1,34 @@
/*
* This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED!
*/
package com.example;
import java.util.Date;
/**
* Provides semantic version information.
*
* @author <a href="https://github.com/ethauvin/semver">Semantic Version Annotation Processor</a>
*/
public final class GeneratedVersion {
public static final String PROJECT = "Java Example";
public static final Date BUILDDATE = new Date(1564027571537L);
public static final int MAJOR = 2;
public static final int MINOR = 10;
public static final int PATCH = 0;
public static final String PRERELEASE = "";
public static final String PRERELEASE_PREFIX = "-";
public static final String BUILDMETA = "";
public static final String BUILDMETA_PREFIX = "+";
public static final String SEPARATOR = ".";
public static final String VERSION = "2.10.0";
/**
* Disables the default constructor.
*/
private GeneratedVersion() {
throw new UnsupportedOperationException("Illegal constructor call.");
}
}

View file

@ -0,0 +1,47 @@
package com.example;
import net.thauvin.erik.semver.Version;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.text.SimpleDateFormat;
@Version(properties = "version.properties")
//@Version(
// properties = "example.properties",
// keysPrefix = "example.",
// preReleaseKey = "release",
// buildMetaKey = "meta")
public class Example {
public static void main(String... args) throws IOException {
final SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z");
System.out.println("-----------------------------------------------------");
System.out.println(" Version: " + GeneratedVersion.PROJECT + ' ' + GeneratedVersion.VERSION);
System.out.println(" Built on: " + sdf.format(GeneratedVersion.BUILDDATE));
System.out.println(" Major: " + GeneratedVersion.MAJOR);
System.out.println(" Minor: " + GeneratedVersion.MINOR);
System.out.println(" Patch: " + GeneratedVersion.PATCH);
System.out.println(" PreRelease: " + GeneratedVersion.PRERELEASE);
System.out.println(" BuildMetaData: " + GeneratedVersion.BUILDMETA);
System.out.println("-----------------------------------------------------");
if (args.length == 1) {
final Path path = Paths.get(args[0]);
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);
}
}
}
}
}

View file

@ -0,0 +1,9 @@
#Generated by the Semver Plugin for Gradle
#Wed Jul 24 21:06:09 PDT 2019
version.buildmeta=
version.major=2
version.minor=10
version.patch=0
version.prerelease=
version.project=Java Example
version.semver=2.10.0

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

View file

@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# batch files are specific to windows and always crlf
*.bat eol=crlf

View file

@ -0,0 +1,81 @@
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
!gradle-wrapper.jar
.classpath
.DS_Store
.gradle
.history
.idea_modules/
.idea/**/contentModel.xml
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/dataSources/
.idea/**/dbnavigator.xml
.idea/**/dictionaries
.idea/**/dynamic.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/**/mongoSettings.xml
.idea/**/shelf
.idea/**/sqlDataSources.xml
.idea/**/tasks.xml
.idea/**/uiDesigner.xml
.idea/**/usage.statistics.xml
.idea/**/workspace.xml
.idea/caches/build_file_checksums.ser
.idea/httpRequests
.idea/replstate.xml
.kobalt
.mtj.tmp/
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.nb-gradle
.project
.scannerwork
.settings
.vscode/*
*.class
*.code-workspace
*.ctxt
*.ear
*.iws
*.jar
*.log
*.nar
*.rar
*.sublime-*
*.tar.gz
*.war
*.zip
atlassian-ide-plugin.xml
bin/
build/
cmake-build-*/
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
dependency-reduced-pom.xml
deploy/
dist/
ehthumbs.db
fabric.properties
gen/
hs_err_pid*
kobaltBuild
kobaltw*-test
lib/kotlin*
libs/
local.properties
out/
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
proguard-project.txt
project.properties
release.properties
target/
test-output
Thumbs.db

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="ap-examples-kotlin.main" target="12" />
<module name="ap-examples-kotlin.test" target="12" />
</bytecodeTargetLevel>
</component>
</project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View file

@ -0,0 +1,53 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="false" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
</component>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.main.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.test.iml" filepath="$PROJECT_DIR$/.idea/modules/ap-examples-kotlin.test.iml" />
</modules>
</component>
</project>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="ap-examples-kotlin" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="11.2.4" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../../build" />
<excludeFolder url="file://$MODULE_DIR$/../../out" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="ap-examples-kotlin:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="11.2.4" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.6" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/main" />
<option name="classpath" value="$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.1.1/semver-1.1.1.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.21/4bcc2012b84840e19e1e28074284cac908be0295/kotlin-stdlib-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.21/f30e4a9897913e53d778f564110bafa1fef46643/kotlin-stdlib-common-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
<option name="moduleName" value="ap-examples-kotlin" />
<option name="addCompilerBuiltIns" value="true" />
<option name="loadBuiltInsFromDependencies" value="true" />
<option name="languageVersion" value="1.3" />
<option name="apiVersion" value="1.3" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths">
<array />
</option>
<option name="errors">
<ArgumentParseErrors />
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../build/generated/source/kapt/main">
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kapt/main" isTestSource="false" generated="true" />
</content>
<content url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/main">
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/main" isTestSource="false" generated="true" />
</content>
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/kotlin" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Gradle: kaptGeneratedClasses">
<CLASSES>
<root url="file://$MODULE_DIR$/../../build/tmp/kapt3/classes/main" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.3.21" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
</component>
</module>

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="ap-examples-kotlin:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="11.2.4" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.6" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
<option name="destination" value="$MODULE_DIR$/../../build/classes/kotlin/test" />
<option name="classpath" value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.21/4bcc2012b84840e19e1e28074284cac908be0295/kotlin-stdlib-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.21/f30e4a9897913e53d778f564110bafa1fef46643/kotlin-stdlib-common-1.3.21.jar;C:/Users/erik/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
<option name="moduleName" value="ap-examples-kotlin" />
<option name="addCompilerBuiltIns" value="true" />
<option name="loadBuiltInsFromDependencies" value="true" />
<option name="friendPaths">
<array>
<option value="$MODULE_DIR$/../../build/classes/java/main" />
<option value="$MODULE_DIR$/../../build/classes/kotlin/main" />
<option value="$MODULE_DIR$/../../build/tmp/kapt3/classes/main" />
</array>
</option>
<option name="languageVersion" value="1.3" />
<option name="apiVersion" value="1.3" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths">
<array />
</option>
<option name="errors">
<ArgumentParseErrors />
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../build/generated/source/kapt/test">
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kapt/test" isTestSource="true" generated="true" />
</content>
<content url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/test">
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/source/kaptKotlin/test" isTestSource="true" generated="true" />
</content>
<content url="file://$MODULE_DIR$/../../src/test" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="ap-examples-kotlin.main" />
<orderEntry type="module-library">
<library name="Gradle: kaptGeneratedClasses">
<CLASSES>
<root url="file://$MODULE_DIR$/../../build/tmp/kapt3/classes/test" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.3.21" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
</component>
<component name="TestModuleProperties" production-module="ap-examples-kotlin.main" />
</module>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,56 @@
plugins {
kotlin("jvm").version("1.3.61")
application
id("org.jetbrains.kotlin.kapt").version("1.3.61")
id("net.thauvin.erik.gradle.semver").version("1.0.4")
id("com.github.ben-manes.versions").version("0.28.0")
}
// ./gradlew
// ./gradlew clean incrementPatch run
// ./gradlew clean incrementMinor run
// ./gradlew clean incrementMajor run
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
var semverProcessor = "net.thauvin.erik:semver:1.2.0"
dependencies {
kapt(semverProcessor)
implementation(semverProcessor)
implementation(kotlin("stdlib"))
}
repositories {
mavenLocal()
jcenter()
}
application {
mainClassName = "com.example.Main"
}
kapt {
arguments {
arg("semver.project.dir", projectDir)
}
}
tasks {
"run"(JavaExec::class) {
doFirst {
println("Verion: $version")
}
// args = listOf("example.properties")
args = listOf("version.properties")
}
}
semver {
// properties = "example.properties"
// keysPrefix = "example."
// preReleaseKey = "release"
// buildMetaKey = "meta"
}

View file

@ -0,0 +1,7 @@
#Generated by the Semver Plugin for Gradle
#Sun Jul 01 21:42:39 PDT 2018
example.major=1
example.release=
example.meta=
example.minor=0
example.patch=0

View file

@ -0,0 +1 @@
#kapt.use.worker.api=true

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
examples/annotation-processor/kotlin/gradlew vendored Executable file
View file

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

View file

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -0,0 +1 @@
rootProject.name = "ap-examples-kotlin"

View file

@ -0,0 +1,45 @@
package com.example
import net.thauvin.erik.semver.Version
import java.io.File
import java.text.SimpleDateFormat
@Version(properties = "version.properties", type = "kt")
//@Version(
// properties = "example.properties",
// type = "kt",
// keysPrefix = "example.",
// preReleaseKey = "release",
// buildMetaKey = "meta")
class Main {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val sdf = SimpleDateFormat("EEE, d MMM yyyy 'at' HH:mm:ss z")
println("-----------------------------------------------------")
println(" Version: ${GeneratedVersion.PROJECT} ${GeneratedVersion.VERSION}")
println(" Built on: " + sdf.format(GeneratedVersion.BUILDDATE))
println(" Major: ${GeneratedVersion.MAJOR}")
println(" Minor: ${GeneratedVersion.MINOR}")
println(" Patch: ${GeneratedVersion.PATCH}")
println(" PreRelease: ${GeneratedVersion.PRERELEASE}")
println(" BuildMetaData: ${GeneratedVersion.BUILDMETA}")
println("-----------------------------------------------------")
if (args.size == 1) {
File(args[0]).apply {
if (exists()) {
println("> cat $name")
forEachLine {
println(it)
}
}
}
}
}
}
}

View file

@ -0,0 +1,9 @@
#Generated by the Semver Plugin for Gradle
#Wed Jul 24 21:06:46 PDT 2019
version.buildmeta=
version.major=14
version.minor=3
version.patch=0
version.prerelease=
version.project=Kotlin Example
version.semver=14.3.0

32
examples/examples.sh Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
# Version 1.0
if [ $# -eq 0 ]; then
echo "Usage: $0 <arg ...>"
exit 1
fi
# set the examples directories
declare -a examples=(
"java"
"kotlin"
"annotation-processor/java"
"annotation-processor/kotlin")
dir=$(dirname "$(readlink -f "$0")")
cyan=$(tput setaf 6)
normal=$(tput sgr0)
i=0
for ex in "${examples[@]}"; do
if [ $i -ne 0 ]
then
read -p "Press [Enter] key to continue..."
clear
fi
cd "$dir/$ex" || exit 1
echo "> Project: ${cyan}${ex}${normal}"
./gradlew --console=plain --no-build-cache clean "$@" || exit 1
(( i++ ))
done

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

5
examples/java/.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# batch files are specific to windows and always crlf
*.bat eol=crlf

82
examples/java/.gitignore vendored Normal file
View file

@ -0,0 +1,82 @@
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
!gradle-wrapper.jar
.classpath
.DS_Store
.gradle
.history
.idea_modules/
.idea/**/contentModel.xml
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/dataSources/
.idea/**/dbnavigator.xml
.idea/**/dictionaries
.idea/**/dynamic.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/**/mongoSettings.xml
.idea/**/shelf
.idea/**/sqlDataSources.xml
.idea/**/tasks.xml
.idea/**/uiDesigner.xml
.idea/**/usage.statistics.xml
.idea/**/workspace.xml
.idea/caches/build_file_checksums.ser
.idea/httpRequests
.idea/replstate.xml
.kobalt
.mtj.tmp/
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.nb-gradle
.project
.scannerwork
.settings
.vscode/*
*.class
*.code-workspace
*.ctxt
*.ear
*.iws
*.jar
*.log
*.nar
*.rar
*.sublime-*
*.tar.gz
*.war
*.zip
atlassian-ide-plugin.xml
bin/
build/
cmake-build-*/
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
dependency-reduced-pom.xml
deploy/
dist/
ehthumbs.db
fabric.properties
gen/
gradle.properties
hs_err_pid*
kobaltBuild
kobaltw*-test
lib/kotlin*
libs/
local.properties
out/
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
proguard-project.txt
project.properties
release.properties
target/
test-output
Thumbs.db

9
examples/java/.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="examples-java.main" target="12" />
<module name="examples-java.test" target="12" />
</bytecodeTargetLevel>
</component>
</project>

6
examples/java/.idea/encodings.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View file

@ -0,0 +1,53 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="false" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
</component>

9
examples/java/.idea/misc.xml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

10
examples/java/.idea/modules.xml generated Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java.main.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/examples-java.test.iml" filepath="$PROJECT_DIR$/.idea/modules/examples-java.test.iml" />
</modules>
</component>
</project>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="examples-java" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="1.1.8-alpha+20180713152249" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../../build" />
<excludeFolder url="file://$MODULE_DIR$/../../out" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="examples-java:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="1.1.8-alpha+20180713152249" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="examples-java:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="1.1.8-alpha+20180713152249" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_12">
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="examples-java.main" />
<orderEntry type="library" name="Gradle: org.junit.jupiter:junit-jupiter-api:5.5.0-M1" level="project" />
<orderEntry type="library" name="Gradle: org.junit.platform:junit-platform-commons:1.5.0-M1" level="project" />
<orderEntry type="library" name="Gradle: org.apiguardian:apiguardian-api:1.0.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.jupiter:junit-jupiter-engine:5.5.0-M1" level="project" />
<orderEntry type="library" name="Gradle: org.opentest4j:opentest4j:1.1.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.platform:junit-platform-engine:1.5.0-M1" level="project" />
</component>
<component name="TestModuleProperties" production-module="examples-java.main" />
</module>

6
examples/java/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,64 @@
plugins {
id 'java'
id 'application'
id 'net.thauvin.erik.gradle.semver' version '1.0.4'
id 'com.github.ben-manes.versions' version '0.36.0'
}
// ./gradlew
// ./gradlew incrementPatch run
// ./gradlew incrementMinor run
// ./gradlew incrementMajor run
// ./gradlew incrementBuildMeta run
// ./gradlew echoVersion
defaultTasks 'run'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
repositories {
jcenter()
}
test {
useJUnitPlatform()
}
application {
mainClassName = 'App'
// project.afterEvaluate {
// println "Version: $version"
// }
}
semver {
// properties = "example.properties"
// keysPrefix = "example."
// preReleaseKey = "release"
// buildMetaKey = "meta"
}
incrementBuildMeta {
doFirst {
// buildMeta = sprintf("%03d", (buildMeta as Integer) + 1)
buildMeta = new Date().format("yyyyMMddHHmmss")
}
}
run {
doFirst {
// println "Version: ${-> version}"
println "Version: $version"
}
// args = ['example.properties']
args = ['version.properties']
}
task echoVersion(type:Exec) {
commandLine 'echo', "${-> project.version}"
}

View file

@ -0,0 +1,7 @@
#Generated by the Semver Plugin for Gradle
#Sun Jul 01 12:21:40 PDT 2018
example.major=1
example.release=alpha
example.meta=
example.minor=1
example.patch=1

Binary file not shown.

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

185
examples/java/gradlew vendored Executable file
View file

@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

89
examples/java/gradlew.bat vendored Normal file
View file

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

9
examples/java/java.iml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.8.1/userguide/multi_project_builds.html
*/
rootProject.name = 'examples-java'

View file

@ -0,0 +1,20 @@
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 App {
public static void main(String... args) throws IOException {
if (args.length == 1) {
final Path path = Paths.get(args[0]);
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);
}
}
}
}
}

View file

@ -0,0 +1,12 @@
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertAll;
class AppTest {
@Test
void testAppHasMain() {
final App classUnderTest = new App();
assertAll("app should have a main method.",
() -> classUnderTest.getClass().getMethod("main", String[].class));
}
}

View file

@ -0,0 +1,8 @@
#Generated by the Semver Plugin for Gradle
#Fri Sep 25 17:38:33 PDT 2020
version.buildmeta=20200925173833
version.major=1
version.minor=0
version.patch=0
version.prerelease=
version.semver=1.0.0+20200925173833

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

5
examples/kotlin/.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# batch files are specific to windows and always crlf
*.bat eol=crlf

82
examples/kotlin/.gitignore vendored Normal file
View file

@ -0,0 +1,82 @@
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
!gradle-wrapper.jar
.classpath
.DS_Store
.gradle
.history
.idea_modules/
.idea/**/contentModel.xml
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/dataSources/
.idea/**/dbnavigator.xml
.idea/**/dictionaries
.idea/**/dynamic.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/**/mongoSettings.xml
.idea/**/shelf
.idea/**/sqlDataSources.xml
.idea/**/tasks.xml
.idea/**/uiDesigner.xml
.idea/**/usage.statistics.xml
.idea/**/workspace.xml
.idea/caches/build_file_checksums.ser
.idea/httpRequests
.idea/replstate.xml
.kobalt
.mtj.tmp/
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.nb-gradle
.project
.scannerwork
.settings
.vscode/*
*.class
*.code-workspace
*.ctxt
*.ear
*.iws
*.jar
*.log
*.nar
*.rar
*.sublime-*
*.tar.gz
*.war
*.zip
atlassian-ide-plugin.xml
bin/
build/
cmake-build-*/
com_crashlytics_export_strings.xml
crashlytics-build.properties
crashlytics.properties
dependency-reduced-pom.xml
deploy/
dist/
ehthumbs.db
fabric.properties
gen/
gradle.properties
hs_err_pid*
kobaltBuild
kobaltw*-test
lib/kotlin*
libs/
local.properties
out/
pom.xml.next
pom.xml.releaseBackup
pom.xml.tag
pom.xml.versionsBackup
proguard-project.txt
project.properties
release.properties
target/
test-output
Thumbs.db

9
examples/kotlin/.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="examples-kotlin.main" target="12" />
<module name="examples-kotlin.test" target="12" />
</bytecodeTargetLevel>
</component>
</project>

6
examples/kotlin/.idea/encodings.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View file

@ -0,0 +1,53 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="false" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
</inspection_tool>
</profile>
</component>

Some files were not shown because too many files have changed in this diff Show more