From 35ba2be624f938bd06b316a75b6125620a45e8cc Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 22:45:39 -0800 Subject: [PATCH 1/7] Bump gradle from 2.14.1 -> 7.6 --- gradle/wrapper/gradle-wrapper.jar | Bin 53319 -> 53324 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew.bat | 180 +++++++++++------------ 3 files changed, 92 insertions(+), 92 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d3b83982b9b1bccad955349d702be9b884c6e049..3baa851b28c65f87dd36a6748e1a85cf360c1301 100644 GIT binary patch delta 2176 zcmZWp3rtg27(TtXg$ixK@+#g!E0`*xQTs#F%>Uf>oed#k~5qmA^$N)myQ%yOlJAT zF%6f|+5AGMOZxb=R>kBp2z)N>M_`+*41ro7xt9wfp{iQ~;ySTcib%iD5dq25gt#J7 zu3P7Y!C1ILhJh;5*ByhYOGe!=n7pc2FqEuy73A)wwQ_!orY0vTA1xg*+V?xkcS1FX zs3TdQZ~sNrtoL5rchVHLwISuH|N1*gNsncZ{*0XxaysPK{`!624=1PsHuae*D?QG> zpQ!%2?rvGvs-D96UNzktY$w_0Wn|9t6*;!3AoUNDhXG+x9opd&O@-G_g>HMY24G(rb`-A%jYg_)VrxjzL4Nj>X{ij%Xp!-z z?TU!yt1bcgwy+BQYL^vNsBvqkWLQA%m);eE*7A!|+}c~k3eI0t4+&elYc>i#w=Tp8 zoPhdk0y5OFM&QID~kd1Hr}kCaszS>)(|pHls6kmW16)zrDYOoKW*U{ z?Gn_UYYE0OZgouDRRSf{sb24-FCA_PLr#W1<4B!^kaa8}ks|*mG{zc-)`eD%Attn* zWl~YQRVd)Lm6NQePpsj3{=IU348R0(b^huK>XT_#@+7LYDfmlIvu&ItjUKWE;=gJe z$Iuiy?C_`eZ3cvttsE1WN++iU)0M4WXudjjLO=x!WE85I@3iJGnOhnV7t+R7!Mq)` zigeWK_qxy(>Av)wU4b40!OD?1s5Ak5!bBebYz2XqhGzIt|2BcV$ZyM7t1BS~;My+` zk&80X{Ys{m=8u!LnZ7mc;MxP(%@vW)=Q>jv%Jp=na{r_5seK^W1}7{M39j!zfnsMM z@2=w;8Bvl${)|bk2l2r7PWEA9|iPq zRS<1&Q{x$hF%emxfZiSS^F(J{qOaQCL0P<=V-6Rh+d+F6LX7||C;}*mzO<_`lVp#D z*Gr+a5GYOjo(+_scC{lAiE&+<2af{r1e7Kw-YFeV*@bG$6runBZt?xtWw^H{1z!0{ z?u0~(ay8Q-M?5CBpq*oORY8ewIVXCt>3r^YaNZdhl6azfs-5RGR{J`qI#p^^_(M<9 z`D#SxWY>T|OJ~?QJnX#=j_JC99`3c=8~IWaeT?tz3-E~&`S{S^JB(;Cy^~`G8qgx6 mGXSB304=(NP+O+~r{pnaF?oZ78Xld~ z6N;x&M;f)+^mdeHuqEwRj6nCY1qM8oLx@i4ZiG+~!%EWZP;li7R67pC#h3XClONGH5 zio@TL!T@2C%fi^8<%&22@5_Eg@TPn(f(D(^&kISo<}4%Lz87RjhWxiNvO#ZEAUR;p z@WY8DS|!JcHa1`^POP);j?vIm$!FcZ>+D{HG-{wyW(2iU(~vReAj=_5S1?EQf^?-2 z2FtTD)m9pn8ZsED5jxYb@aN3T+lq?ceP2$=EBWz{ zft`PK?x?7DdFH(scP8AJsL+J3TT?xwb)e;&pH8nX`sIZkVVi@iNgS80$qtFG^lN(e zT32G(2VZXeblTg8f}+DGwJ$0TUwLAC%2Zq9!z1RHlMiZq9v9P^B5}i8*uM3GsFlfmLRHZhg_AV+d*<2@!GEq*pvEO85sQMC{xb`>6aA`}8lsT8z4zs0q>J~Gfi}guNGvRPQ zBX^F>XPVSwfKhOzIZaBt3St~n#oYzPju^a{S_iM&O)q41p)De9wuBomWi2UO+9d}s zaln0t5tW7(Uh*6Grt2WJ1$zNrZ{azU1ionVhct;6s#;Vitf5%KjbLv`;6g#u%9c#6 zJhxVcOLJR!RIj9HsT|Rs)`=FOwF0j!KJSzha*u8$n(pn<(^#rhqA*Tr0b?7pw6^hF zkOuLR4h1aK_)UJ|9Lc#QuEFgxLK3_QiF{;6$HvloU~ij&IrpuPJet8#Nb{OSnsfeW zt`1OvrJd!BXy>_=dc=0UA1GZa^oYIKbbY^Ahk0j zQ_u)dsG#upuz~(-$-hZi*{s2Ag-de_mPh0i*H#R!Ycp zk*28(2Fl_gv6tnU+sktwm1CZYUe*&^_BHBk;|S@b%_#Pdg~49tpXKxX>1uj%E8U0q zRlaIRGq=YJGF=AT%uA=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 -if "%@eval[2+2]" == "4" goto 4NT_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=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -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 +@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 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= + +@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 +if "%@eval[2+2]" == "4" goto 4NT_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=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +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 From efda698dd095f411c114257c5319c944bf6dfd13 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 22:53:56 -0800 Subject: [PATCH 2/7] Remove spotless metadata and ci scripts. --- .ci/ci.sh | 11 -- .ci/push-javadoc.sh | 37 ----- spotless.eclipseformat.xml | 295 ------------------------------------- spotless.importorder | 7 - spotless.license.java | 15 -- 5 files changed, 365 deletions(-) delete mode 100755 .ci/ci.sh delete mode 100755 .ci/push-javadoc.sh delete mode 100644 spotless.eclipseformat.xml delete mode 100644 spotless.importorder delete mode 100644 spotless.license.java diff --git a/.ci/ci.sh b/.ci/ci.sh deleted file mode 100755 index 14af644..0000000 --- a/.ci/ci.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Do the Gradle build -./gradlew build || exit 1 - -if [ "$TRAVIS_REPO_SLUG" == "diffplug/freshmark" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then - # Publish the artifacts - ./gradlew publish || exit 1 - # Push the javadoc - ./.ci/push-javadoc.sh -fi diff --git a/.ci/push-javadoc.sh b/.ci/push-javadoc.sh deleted file mode 100755 index f5e73d5..0000000 --- a/.ci/push-javadoc.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -echo "Pushing javadoc to gh-pages..." - -# save the version -VERSION=$(./gradlew -q printVersion) - -# copy javadoc from the build to ~/javadoc-temp -cp -R build/docs/javadoc $HOME/javadoc-temp - -# clone a new copy durian-rx to gh-pages -cd $HOME -git config --global user.email "travis@travis-ci.org" -git config --global user.name "travis-ci" -rm -rf $HOME/gh-pages -git clone --quiet --branch=gh-pages https://${gh_token}@github.com/diffplug/freshmark gh-pages > /dev/null - -# copy the javadoc into the build -cd gh-pages -mkdir -p javadoc -if [[ "$VERSION" != *SNAPSHOT* ]]; then - git rm -rf javadoc/${VERSION} - cp -Rf $HOME/javadoc-temp/ ./javadoc/${VERSION}/ -else - git rm -rf javadoc/snapshot - cp -Rf $HOME/javadoc-temp/ ./javadoc/snapshot/ -fi - -# add all of the stuff and commit it -git add -f -A -git commit -m "Lastest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages" -if ! git push -fq origin gh-pages &> /dev/null; then - echo "Error pushing javadoc to origin. Bad gh_token? GitHub down?" - exit 1 -else - echo "Pushed javadoc to gh-pages." -fi diff --git a/spotless.eclipseformat.xml b/spotless.eclipseformat.xml deleted file mode 100644 index 613e633..0000000 --- a/spotless.eclipseformat.xml +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spotless.importorder b/spotless.importorder deleted file mode 100644 index 77b3528..0000000 --- a/spotless.importorder +++ /dev/null @@ -1,7 +0,0 @@ -#Organize Import Order -#Fri Apr 24 02:36:28 PDT 2015 -4=com.diffplug -3=com -2=org -1=javax -0=java diff --git a/spotless.license.java b/spotless.license.java deleted file mode 100644 index ab22092..0000000 --- a/spotless.license.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2015 DiffPlug - * - * 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 - * - * http://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. - */ \ No newline at end of file From 7335bc79e7c831e561c7c16156e94c544d2b84a0 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 22:54:52 -0800 Subject: [PATCH 3/7] Update build. --- CHANGELOG.md | 16 ++++ CHANGES.md | 16 ---- build.gradle | 234 +++------------------------------------------- gradle.properties | 24 ++--- settings.gradle | 30 ++++++ 5 files changed, 65 insertions(+), 255 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 CHANGES.md create mode 100644 settings.gradle diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..22e5245 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# FreshMark releases + +## [Unreleased] + +## [1.3.1] - 2016-08-16 + +- Updated dependencies. + +## [1.3.0] - 2015-09-22 + +- Added a console interface. +- Improved line numbers for error reporting. + +## [1.2.0] - 2015-09-21 + +- First stable release. diff --git a/CHANGES.md b/CHANGES.md deleted file mode 100644 index c12ae22..0000000 --- a/CHANGES.md +++ /dev/null @@ -1,16 +0,0 @@ -# FreshMark releases - -### Version 1.4.0 - TBD ([javadoc](http://diffplug.github.io/freshmark/javadoc/snapshot/)) - -### Version 1.3.1 - August 16th 2016 ([javadoc](http://diffplug.github.io/freshmark/javadoc/1.3.1/), [jcenter](https://bintray.com/diffplug/opensource/freshmark/1.3.1/view)) - -* Updated dependencies. - -### Version 1.3.0 - September 22nd 2015 ([javadoc](http://diffplug.github.io/freshmark/javadoc/1.3.0/), [jcenter](https://bintray.com/diffplug/opensource/freshmark/1.3.0/view)) - -* Added a console interface. -* Improved line numbers for error reporting. - -### Version 1.2.0 - September 21st 2015 ([javadoc](http://diffplug.github.io/freshmark/javadoc/1.2.0/), [jcenter](https://bintray.com/diffplug/opensource/freshmark/1.2.0/view)) - -* First stable release. diff --git a/build.gradle b/build.gradle index e41f77c..218cf9e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,233 +1,23 @@ plugins { - // code formatting - id "com.diffplug.gradle.spotless" version "1.3.0" - // bintray uploading - id "com.jfrog.bintray" version "1.3.1" + id 'com.diffplug.blowdryer' + id 'com.diffplug.spotless-changelog' } repositories { mavenCentral() - // SNAPSHOT versions are free to rely on other SNAPSHOT libraries - if (project.version.endsWith('-SNAPSHOT')) { - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' - } - } } -////////// -// JAVA // -////////// -apply plugin: 'java' -sourceCompatibility = VER_JAVA -targetCompatibility = VER_JAVA +apply from: 干.file('spotless/java.gradle') +apply from: 干.file('spotless/freshmark.gradle') +apply from: 干.file('base/java.gradle') +apply plugin: 'java-library' dependencies { - compile "com.diffplug.jscriptbox:jscriptbox:${VER_JSCRIPTBOX}" - compile "com.diffplug.durian:durian-core:${VER_DURIAN}" - compile "args4j:args4j:${VER_ARGS4J}" - testCompile "junit:junit:${VER_JUNIT}" + implementation 'com.diffplug.jscriptbox:jscriptbox:3.0.0' + implementation 'com.diffplug.durian:durian-core:1.2.0' + implementation 'args4j:args4j:2.33' + testImplementation 'junit:junit:4.13.2' } -///////////// -// ECLIPSE // -///////////// -apply plugin: 'eclipse' -eclipse { - classpath { - downloadSources true - downloadJavadoc true - } - jdt { - sourceCompatibility VER_JAVA - targetCompatibility VER_JAVA - } -} -// always create fresh projects -tasks.eclipse.dependsOn(cleanEclipse) - -//////////// -// FORMAT // -//////////// -apply plugin: 'com.diffplug.gradle.spotless' -spotless { - java { - licenseHeaderFile 'spotless.license.java' // License header file - importOrderFile 'spotless.importorder' // An import ordering file, exported from Eclipse - eclipseFormatFile 'spotless.eclipseformat.xml' // XML file dumped out by the Eclipse formatter - // Eclipse formatter puts excess whitespace after lambda blocks - // funcThatTakesLambdas(x -> {} , y -> {} ) // what Eclipse does - // funcThatTakesLambdas(x -> {}, y -> {}) // what I wish Eclipse did - custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') } - } - format 'misc', { - target '**/.gitignore', '**/*.gradle', '**/*.md', '**/*.sh' - indentWithTabs() - trimTrailingWhitespace() - endWithNewline() - } - freshmark {} -} - -////////////// -// FINDBUGS // -////////////// -apply plugin: 'findbugs' -findbugs { - toolVersion = VER_FINDBUGS - sourceSets = [sourceSets.main] // don't check the test code - ignoreFailures = false // bug free or it doesn't ship! - reportsDir = file('build/findbugs') - effort = 'max' // min|default|max - reportLevel = 'low' // low|medium|high (low = sensitive to even minor mistakes) - omitVisitors = [] // bugs that we want to ignore -} -// HTML instead of XML -tasks.withType(FindBugs) { - reports { - xml.enabled = false - html.enabled = true - } -} -// we'll want the findbugs annotations (they don't have a 3.0.1 version) -dependencies { - compile 'com.google.code.findbugs:annotations:3.0.0' - compile 'com.google.code.findbugs:jsr305:3.0.0' -} - -/////////// -// MAVEN // -/////////// -apply plugin: 'maven-publish' - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allJava -} - -// Where it's possible to name parameters and methods clearly enough -// that javadoc is not necessary, why make the code bigger? -// -// Thus, no javadoc warnings. -def makeLink = { url, text -> "${text}" } -def javadocInfo = '

' + makeLink("https://github.com/${org}/${name}", "${group}:${name}:${version}") + -' by ' + makeLink('http://www.diffplug.com', 'DiffPlug') + '

' -javadoc { - options.addStringOption('Xdoclint:none', '-quiet') - options.header javadocInfo - options.footer javadocInfo - options.links('https://diffplug.github.io/durian/javadoc/' + (VER_DURIAN.endsWith('-SNAPSHOT') ? 'snapshot' : VER_DURIAN) + '/') - options.links('https://docs.oracle.com/javase/8/docs/api/') -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -task freshmarkConsole(type: JavaExec, dependsOn: classes) { - description = 'Runs the FreshMark console' - classpath = sourceSets.main.runtimeClasspath - main = 'com.diffplug.freshmark.FreshMarkConsole' - if (project.hasProperty('args')) { - args project.args.split('\\s+') - } -} - -//////////////// -// PUBLISHING // -//////////////// -def isSnapshot = project.version.endsWith('-SNAPSHOT') -// pulls the credentials from either the environment variable or gradle.properties -def cred = { - if (System.env[it] != null) { - return System.env[it] - } else if (project.hasProperty(it)) { - return project[it] - } else { - return 'unknown_' + it - } -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - artifact sourcesJar - artifact javadocJar - pom.withXml { - // findbugs annotations should have scope "provided" - asNode().dependencies.'*'.findAll() { it.groupId.text() == 'com.google.code.findbugs' }.each() { it.scope*.value = 'provided' } - // add MavenCentral requirements to the POM - asNode().children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST - name project.name - description project.description - url "https://github.com/${project.org}/${project.name}" - scm { - url "https://github.com/${project.org}/${project.name}" - connection "scm:git:git://github.com/${project.org}/${project.name}" - developerConnection "scm:git:ssh:git@github.com/${project.org}/${project.name}" - } - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/license/LICENSE-2.0.txt' - distribution 'repo' - } - } - developers { - developer { - id 'nedtwigg' - name 'Ned Twigg' - email 'ned.twigg@diffplug.com' - } - } - } - } - } - } - if (isSnapshot) { - // upload snapshots to oss.sonatype.org - repositories { maven { - url = 'https://oss.sonatype.org/content/repositories/snapshots' - credentials { - username = cred('nexus_user') - password = cred('nexus_pass') - } - } } - } -} - -if (!isSnapshot) { - // upload releases to bintray and then mavenCentral - bintray { - user = cred('bintray_user') - key = cred('bintray_pass') - publications = ['mavenJava'] - publish = true - pkg { - repo = 'opensource' - name = project.name - userOrg = project.org - version { - name = project.version - mavenCentralSync { - user = cred('nexus_user') - password = cred('nexus_pass') - } - } - } - } - - publish.dependsOn(bintrayUpload) - bintrayUpload.dependsOn(['generatePomFileForMavenJavaPublication', jar, sourcesJar, javadocJar]) -} - -// helps external scripts detect version -task printVersion << { - println version -} +apply from: 干.file('base/maven.gradle') +apply from: 干.file('base/sonatype.gradle') \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 6607711..57e0b56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,18 +1,8 @@ -stable=1.3.1 -version=1.4.0-SNAPSHOT -name=freshmark -group=com.diffplug.freshmark -description=FreshMark - Keep your markdown fresh -org=diffplug +git_url=github.com/diffplug/freshmark +maven_group=com.diffplug.freshmark +maven_name=freshmark +maven_desc=FreshMark - Keep your markdown fresh +license=apache -# Build requirements -VER_JAVA=1.8 -VER_FINDBUGS=3.0.1 - -# Dependencies -VER_JSCRIPTBOX=3.0.0 -VER_DURIAN=1.2.0 -VER_ARGS4J=2.33 - -# Testing -VER_JUNIT=4.12 +ver_java=8 +javadoc_links= \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..eea6946 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,30 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} +plugins { + // https://github.com/diffplug/blowdryer/blob/main/CHANGELOG.md + id 'com.diffplug.blowdryerSetup' version '1.7.0' + // https://github.com/diffplug/spotless/blob/main/plugin-gradle/CHANGES.md + id 'com.diffplug.spotless' version '6.14.0' apply false + // https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md + id 'com.diffplug.spotless-changelog' version '2.4.1' apply false + // https://plugins.gradle.org/plugin/com.gradle.plugin-publish + id 'com.gradle.plugin-publish' version '1.1.0' apply false + // https://github.com/equodev/equo-ide/blob/main/plugin-gradle/CHANGELOG.md + id 'dev.equo.ide' version '0.12.1' apply false + // https://github.com/gradle-nexus/publish-plugin/releases + id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false +} + +blowdryerSetup { + github 'diffplug/blowdryer-diffplug', 'tag', '7.0.0' + //devLocal '../blowdryer-diffplug' + setPluginsBlockTo { + it.file 'plugin.versions' + } +} + +rootProject.name = 'jscriptbox' From 26842bcc9041d5c92df9a7e17141c38404a1e796 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 23:01:29 -0800 Subject: [PATCH 4/7] Remove FindBugs. --- .../java/com/diffplug/freshmark/FreshMarkConsole.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/diffplug/freshmark/FreshMarkConsole.java b/src/main/java/com/diffplug/freshmark/FreshMarkConsole.java index bfb8d57..03ae81c 100644 --- a/src/main/java/com/diffplug/freshmark/FreshMarkConsole.java +++ b/src/main/java/com/diffplug/freshmark/FreshMarkConsole.java @@ -1,11 +1,11 @@ /* - * Copyright 2015 DiffPlug + * Copyright (C) 2015-2023 DiffPlug * * 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 * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, @@ -28,13 +28,10 @@ import java.util.List; import java.util.Map; import java.util.Properties; - import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; import org.kohsuke.args4j.spi.MapOptionHandler; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - public class FreshMarkConsole { /** Prints the usage for the given command. */ public static void printUsage(String name, CmdLineParser parser, PrintStream stream) { @@ -75,7 +72,6 @@ public boolean isWin() { private static final Charset CHARSET = StandardCharsets.UTF_8; - @SuppressFBWarnings(value = {"REC_CATCH_EXCEPTION", "UR_UNINIT_READ"}, justification = "we don't want to bother the console user with stacktraces, and fields are set by args4j magic") public FreshMarkConsole(String[] args) { CmdLineParser parser = new CmdLineParser(this); try { From f30d1431fbbcc5acd04834727e09a58cd5ccaf15 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 23:02:39 -0800 Subject: [PATCH 5/7] Update github workflows. --- .github/workflows/changelog-print.yml | 22 ++++++++ .github/workflows/ci.yml | 40 +++++++++++++++ .github/workflows/deploy.yml | 51 +++++++++++++++++++ .../workflows/gradle-wrapper-validation.yml | 23 +++++++++ 4 files changed, 136 insertions(+) create mode 100644 .github/workflows/changelog-print.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/gradle-wrapper-validation.yml diff --git a/.github/workflows/changelog-print.yml b/.github/workflows/changelog-print.yml new file mode 100644 index 0000000..a3009e3 --- /dev/null +++ b/.github/workflows/changelog-print.yml @@ -0,0 +1,22 @@ +name: changelogPrint + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + name: changelogPrint + steps: + - uses: actions/checkout@v3 + - name: jdk 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'temurin' + - name: gradle caching + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew changelogPrint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a3d5d18 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +on: + pull_request: + push: + branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + build: + strategy: + fail-fast: false + matrix: + jre: [11, 17] + os: [ubuntu-latest] + include: + - jre: 17 + os: windows-latest + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install JDK ${{ matrix.jre }} + uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: ${{ matrix.jre }} + - name: gradle caching + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: git fetch origin main + run: git fetch origin main + - name: gradlew build + run: ./gradlew build + - name: junit result + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + check_name: JUnit ${{ matrix.jre }} ${{ matrix.os }} + report_paths: '*/build/test-results/*/TEST-*.xml' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3d95da7 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,51 @@ +# GH_TOKEN +# NEXUS_USER +# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java +# byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8); +# String encoded = new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8); +# System.out.println(encoded); +# GPG_PASSPHRASE +# GPG_KEY64 (base64) +# gpg --export-secret-keys --armor KEY_ID | openssl base64 | pbcopy +# GRADLE_KEY +# GRADLE_SECRET + +name: deploy +on: + workflow_dispatch: + inputs: + to_publish: + description: 'What to publish' + required: true + default: 'all' + type: choice + options: + - all + +jobs: + build: + runs-on: ubuntu-latest + name: deploy + env: + gh_token: ${{ secrets.GH_TOKEN }} + ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }} + ORG_GRADLE_PROJECT_nexus_pass64: ${{ secrets.NEXUS_PASS64 }} + ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} + ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }} + steps: + - uses: actions/checkout@v3 + - name: jdk 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'temurin' + - name: gradle caching + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: git fetch origin main + run: git fetch origin main + - name: publish all + if: "${{ github.event.inputs.to_publish == 'all' }}" + run: | + ./gradlew :changelogPush -Prelease=true -Penable_publishing=true -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }} --stacktrace --warning-mode all diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000..2c02ce0 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,23 @@ +name: "Validate Gradle Wrapper" +on: + push: + paths: + - 'gradlew' + - 'gradlew.bat' + - 'gradle/wrapper/' + pull_request: + paths: + - 'gradlew' + - 'gradlew.bat' + - 'gradle/wrapper/' + +permissions: + contents: read + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 From 5132225af913df2020082086c6a2a95b33cd9250 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 23:51:12 -0800 Subject: [PATCH 6/7] Fixup build. --- .gitignore | 3 +++ settings.gradle | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f66f34c..69dd97c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ build/ .classpath .settings/ bin/ + +# IntelliJ +.idea/ \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index eea6946..cf930d2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -27,4 +27,4 @@ blowdryerSetup { } } -rootProject.name = 'jscriptbox' +rootProject.name = 'freshmark' From 24dd607836092dc638ef9210bdc98d8181624f82 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sat, 4 Feb 2023 23:53:31 -0800 Subject: [PATCH 7/7] Add nashorn on Java 15+ --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 218cf9e..42eb57e 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,9 @@ dependencies { implementation 'com.diffplug.durian:durian-core:1.2.0' implementation 'args4j:args4j:2.33' testImplementation 'junit:junit:4.13.2' + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_15)) { + testImplementation 'org.openjdk.nashorn:nashorn-core:15.4' + } } apply from: 干.file('base/maven.gradle')