|
| 1 | +task bumpReadmeVersion { |
| 2 | + doLast { |
| 3 | + // README.md |
| 4 | + ant.replaceregexp(match: "$projectPreviousPublishedVersion", replace: "$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 5 | + fileset(dir: '.', includes: 'README.md') |
| 6 | + fileset(dir: './picocli-codegen/', includes: 'README.adoc') |
| 7 | + fileset(dir: './picocli-groovy/', includes: 'README.md') |
| 8 | + fileset(dir: './picocli-shell-jline2/', includes: 'README.md') |
| 9 | + fileset(dir: './picocli-shell-jline3/', includes: 'README.md') |
| 10 | + fileset(dir: './picocli-spring-boot-starter/', includes: 'README.md') |
| 11 | + fileset(dir: './picocli-examples/annotation-processing/') { |
| 12 | + include(name: '**/pom.xml') |
| 13 | + include(name: '**/build.gradle') |
| 14 | + } |
| 15 | + fileset(dir: './picocli-examples/generate-man-pages/') { |
| 16 | + include(name: '**/pom.xml') |
| 17 | + include(name: '**/build.gradle') |
| 18 | + } |
| 19 | + //fileset(dir: './picocli-examples/src/main/groovy/', includes: '**/*.groovy') |
| 20 | + } |
| 21 | + } |
| 22 | +} |
| 23 | +task bumpVersion { |
| 24 | + doLast { |
| 25 | + ant.replaceregexp(match: "$projectPreviousVersionRegex", replace: "$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 26 | + fileset(dir: 'src/main/java/picocli', includes: 'CommandLine.java') |
| 27 | + fileset(dir: 'src/test/java/picocli', includes: 'CommandLineTest.java') |
| 28 | + fileset(dir: 'src/main/java/picocli', includes: 'AutoComplete.java') |
| 29 | + fileset(dir: 'src/test/java/picocli', includes: 'AutoCompleteTest.java') |
| 30 | + fileset(dir: 'picocli-codegen/src/main/java/picocli/codegen/aot/graalvm', includes: 'DynamicProxyConfigGenerator.java') |
| 31 | + fileset(dir: 'picocli-codegen/src/main/java/picocli/codegen/aot/graalvm', includes: 'JniConfigGenerator.java') |
| 32 | + fileset(dir: 'picocli-codegen/src/main/java/picocli/codegen/aot/graalvm', includes: 'ReflectionConfigGenerator.java') |
| 33 | + fileset(dir: 'picocli-codegen/src/main/java/picocli/codegen/aot/graalvm', includes: 'ResourceConfigGenerator.java') |
| 34 | + fileset(dir: 'picocli-codegen/src/main/java/picocli/codegen/docgen/manpage', includes: 'ManPageGenerator.java') |
| 35 | + } |
| 36 | + ant.replaceregexp(match: "version $projectPreviousVersionRegex", replace: "version $version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 37 | + fileset(dir: 'src/test/java/picocli', includes: 'AutoCompleteTest.java') |
| 38 | + } |
| 39 | + // Doc header |
| 40 | + ant.replaceregexp(match: ":revnumber: $projectPreviousVersionRegex", replace: ":revnumber: $version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 41 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 42 | + fileset(dir: 'docs', includes: 'quick-guide.adoc') |
| 43 | + fileset(dir: 'docs', includes: 'autocomplete.adoc') |
| 44 | + fileset(dir: 'docs', includes: 'picocli-programmatic-api.adoc') |
| 45 | + } |
| 46 | + // Annotation Processor section |
| 47 | + ant.replaceregexp(match: ":picocli-codegen:$projectPreviousVersionRegex", replace: ":picocli-codegen:$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 48 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 49 | + } |
| 50 | + // Groovy section |
| 51 | + ant.replaceregexp(match: ":picocli-groovy:$projectPreviousVersionRegex", replace: ":picocli-groovy:$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 52 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 53 | + } |
| 54 | + // Spring Boot section |
| 55 | + ant.replaceregexp(match: ":picocli-spring-boot-starter:$projectPreviousVersionRegex", replace: ":picocli-spring-boot-starter:$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 56 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 57 | + } |
| 58 | + // Downloads section, Gradle |
| 59 | + ant.replaceregexp(match: ":picocli:$projectPreviousVersionRegex", replace: ":picocli:$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 60 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 61 | + } |
| 62 | + // Downloads section, Maven |
| 63 | + ant.replaceregexp(match: "<version>$projectPreviousVersionRegex</version>", replace: "<version>$version</version>", flags: 'g', byline: true, encoding: 'UTF8') { |
| 64 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 65 | + } |
| 66 | + // Downloads section, SBT |
| 67 | + ant.replaceregexp(match: "\"picocli\" % \"$projectPreviousVersionRegex\"", replace: "\\\"picocli\\\" % \\\"$version\\\"", flags: 'g', byline: true, encoding: 'UTF8') { |
| 68 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 69 | + } |
| 70 | + // Downloads section, Ivy |
| 71 | + ant.replaceregexp(match: "rev=\"$projectPreviousVersionRegex\"", replace: "rev=\\\"$version\\\"", flags: 'g', byline: true, encoding: 'UTF8') { |
| 72 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 73 | + } |
| 74 | + // Downloads section, Grape |
| 75 | + ant.replaceregexp(match: "module='picocli', version=\'$projectPreviousVersionRegex\'\\)", replace: "module='picocli', version=\'$version\')", flags: 'g', byline: true, encoding: 'UTF8') { |
| 76 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 77 | + } |
| 78 | + // Downloads section, Leiningen |
| 79 | + ant.replaceregexp(match: "info.picocli/picocli \"$projectPreviousVersionRegex\"", replace: "info.picocli/picocli \"$version\"", flags: 'g', byline: true, encoding: 'UTF8') { |
| 80 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 81 | + } |
| 82 | + // Downloads section, Buildr |
| 83 | + ant.replaceregexp(match: "info.picocli:picocli:jar:$projectPreviousVersionRegex", replace: "info.picocli:picocli:jar:$version", flags: 'g', byline: true, encoding: 'UTF8') { |
| 84 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 85 | + } |
| 86 | + // Running the Application and Packaging sections |
| 87 | + ant.replaceregexp(match: "picocli-${projectPreviousVersionRegex}.jar", replace: "picocli-${version}.jar", flags: 'g', byline: true, encoding: 'UTF8') { |
| 88 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 89 | + fileset(dir: 'docs', includes: 'quick-guide.adoc') |
| 90 | + } |
| 91 | + ant.replaceregexp(match: releaseDatePreviousRegex, replace: releaseDate, flags: 'g', byline: true, encoding: 'UTF8') { |
| 92 | + fileset(dir: 'docs', includes: 'index.adoc') |
| 93 | + fileset(dir: 'docs', includes: 'quick-guide.adoc') |
| 94 | + fileset(dir: 'docs', includes: 'autocomplete.adoc') |
| 95 | + fileset(dir: 'docs', includes: 'picocli-programmatic-api.adoc') |
| 96 | + fileset(dir: 'picocli-codegen', includes: 'README.adoc') |
| 97 | + } |
| 98 | + } |
| 99 | +} |
| 100 | +task copyCodeGenDocs(type: Copy) { |
| 101 | + from('build/docs/man/') { include 'index.html' } |
| 102 | + from('picocli-codegen/build/docs/html5/') { include '*.html' } |
| 103 | + into 'docs/man' |
| 104 | +} |
| 105 | +task copyDocs(type: Copy) { |
| 106 | + dependsOn(copyCodeGenDocs) |
| 107 | + from('build/docs/') |
| 108 | + into 'docs' |
| 109 | +} |
| 110 | + |
| 111 | + |
| 112 | +/* |
| 113 | +Release procedure: |
| 114 | +1. edit version numbers: remove -SNAPSHOT classifier; edit releaseDate |
| 115 | +2. gradlew bumpVersion |
| 116 | +3. check modified files |
| 117 | +4. gradlew clean build |
| 118 | +5. gradlew copyDocs |
| 119 | +6. update RELEASE-NOTES.md |
| 120 | +7. gradlew bumpReadmeVersion |
| 121 | +7a update README.md (latest version, release notes) |
| 122 | +8. commit -m "Release picocli version ..." |
| 123 | +9. tag v$version |
| 124 | +10. gradlew bintrayUpload - to publish to bintray.com |
| 125 | +
|
| 126 | +11. edit version numbers: increase minor version and add -SNAPSHOT classifier |
| 127 | +12. gradlew bumpVersion |
| 128 | +13. check modified files |
| 129 | +14. commit -m "Prepare for next development cycle" |
| 130 | +15. push (make sure that Push Tags is checked) |
| 131 | +
|
| 132 | +16. Log in to GitHub, go to https://github.com/remkop/picocli/releases |
| 133 | +17. Click the new tag, click Edit button, update title and release notes (copy from RELEASE-NOTES.md) |
| 134 | +18. Upload picocli-$version.jar and picocli-all$version.zip to GitHub |
| 135 | +
|
| 136 | +19. Log in to Bintray |
| 137 | +20. Navigate to the page for the new version |
| 138 | +21. Edit version: Publication Date, Description, VCS tag, GitHub release notes file (RELEASE-NOTES.md) |
| 139 | +22. On the version page, Release Notes tab, select GitHub File |
| 140 | +23. Publish artifacts to JCenter |
| 141 | +24. On the version page, Maven Central tab, sync to Maven (takes several minutes) |
| 142 | +
|
| 143 | +(When releasing from branch) |
| 144 | +25. Switch to master |
| 145 | +26. cherry-pick the "Release picocli version ..." commit |
| 146 | +27. gradlew bumpVersion |
| 147 | +28. check modified files |
| 148 | +29. commit -m "Update master for next development cycle after release x.x (from branch x.x)" |
| 149 | +*/ |
0 commit comments