diff --git a/.editorconfig b/.editorconfig index a7e9248744..eed8eb0a72 100644 --- a/.editorconfig +++ b/.editorconfig @@ -22,3 +22,6 @@ indent_size = 4 [*.md] trim_trailing_whitespace = false + +[gradle/verification-metadata.xml] +indent_size = 3 diff --git a/.gitattributes b/.gitattributes index eb5b2ee76e..337403332f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ * text=auto *.bat eol=crlf +*.gpg binary diff --git a/CHANGELOG.md b/CHANGELOG.md index fb9a95827c..146d360e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Experimental SpacingAroundAngleBracketsRule ([#769](https://github.com/pinterest/ktlint/pull/769)) - Checksum generation for executable Jar ([#695](https://github.com/pinterest/ktlint/issues/695)) +- Enable Gradle dependency verification + +### Changed +- Update Gradle to 6.5 version ## [0.37.2] - 2020-06-16 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e6bdfeb5e..7397c2a596 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,12 @@ without having to change the core ruleset. New core rules will be added first to the experimental ruleset before being rolled out widely. +## Updating dependencies + +Project has enabled [Gradle dependencies verification](https://docs.gradle.org/6.2/userguide/dependency_verification.html). +On adding/updating any dependency, ensure that you've added dependency provided checksum/signature to `gradle/verification-metadata.xml` file. + ## License By contributing to this project, you agree that your contributions will be -licensed under its [license](LICENSE). \ No newline at end of file +licensed under its [license](LICENSE). diff --git a/build.gradle b/build.gradle index 2f43e3c1ab..593a9bdba5 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { ext.versions = [ 'kotlin': '1.3.70', - 'gradle': '5.6.2' + 'gradle': '6.5' ] ext.deps = [ @@ -40,7 +40,7 @@ task ktlint(type: JavaExec, group: LifecycleBasePlugin.VERIFICATION_GROUP) { allprojects { repositories { - gradlePluginPortal() + mavenCentral() } tasks.withType(JavaCompile) { diff --git a/gradle.properties b/gradle.properties index 76f2c8a1cf..df89439abe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,3 +13,7 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=pinterest POM_DEVELOPER_NAME=Pinterest, Inc. + +# Gradle properties +org.gradle.parallel=true +org.gradle.caching=true diff --git a/gradle/verification-keyring.gpg b/gradle/verification-keyring.gpg new file mode 100644 index 0000000000..39f0105301 Binary files /dev/null and b/gradle/verification-keyring.gpg differ diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml new file mode 100644 index 0000000000..444dd1144b --- /dev/null +++ b/gradle/verification-metadata.xml @@ -0,0 +1,236 @@ + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7c4388a921..622ab64a3c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index b0d6d0ab5d..83f2acfdc3 100755 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ # 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, @@ -125,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# 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"` diff --git a/gradlew.bat b/gradlew.bat index 9991c50326..9618d8d960 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -5,7 +5,7 @@ @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 http://www.apache.org/licenses/LICENSE-2.0 +@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, diff --git a/settings.gradle b/settings.gradle index 2179b41869..47bf14e2e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + rootProject.name = 'ktlint' include ':ktlint'