Skip to content

Commit

Permalink
Polish quote form used in Gradle scripts
Browse files Browse the repository at this point in the history
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
  • Loading branch information
philwebb committed Jan 22, 2020
1 parent ed6fbc6 commit 0209cd3
Show file tree
Hide file tree
Showing 175 changed files with 3,234 additions and 3,235 deletions.
13 changes: 6 additions & 7 deletions build.gradle
@@ -1,20 +1,19 @@
plugins {
id 'org.jetbrains.kotlin.jvm' apply false // https://youtrack.jetbrains.com/issue/KT-30276
id "org.jetbrains.kotlin.jvm" apply false // https://youtrack.jetbrains.com/issue/KT-30276
}

description = 'Spring Boot Build'
description = "Spring Boot Build"

allprojects {
group 'org.springframework.boot'
group "org.springframework.boot"

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo.spring.io/snapshot" }
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 60, 'minutes'
resolutionStrategy.cacheChangingModulesFor 60, "minutes"
}

}
32 changes: 16 additions & 16 deletions buildSrc/build.gradle
@@ -1,36 +1,36 @@
plugins {
id 'java-gradle-plugin'
id 'io.spring.javaformat' version "${javaFormatVersion}"
id 'checkstyle'
id "java-gradle-plugin"
id "io.spring.javaformat" version "${javaFormatVersion}"
id "checkstyle"
}

repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/release' }
maven { url "https://repo.spring.io/release" }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.0'
implementation 'commons-codec:commons-codec:1.13'
implementation 'org.apache.maven:maven-embedder:3.6.2'
implementation 'org.asciidoctor:asciidoctor-gradle-jvm:2.4.0'
implementation 'org.springframework:spring-core:5.2.2.RELEASE'
implementation 'org.springframework:spring-web:5.2.2.RELEASE'
implementation 'com.google.code.gson:gson:2.8.5'
implementation "com.fasterxml.jackson.core:jackson-databind:2.10.0"
implementation "commons-codec:commons-codec:1.13"
implementation "org.apache.maven:maven-embedder:3.6.2"
implementation "org.asciidoctor:asciidoctor-gradle-jvm:2.4.0"
implementation "org.springframework:spring-core:5.2.2.RELEASE"
implementation "org.springframework:spring-web:5.2.2.RELEASE"
implementation "com.google.code.gson:gson:2.8.5"
implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}"
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.apache.logging.log4j:log4j-core:2.12.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
testImplementation "org.assertj:assertj-core:3.11.1"
testImplementation "org.apache.logging.log4j:log4j-core:2.12.1"
testImplementation "org.junit.jupiter:junit-jupiter:5.5.2"
}

checkstyle {
def archive = configurations.checkstyle.filter { it.name.startsWith('spring-javaformat-checkstyle')}
config = resources.text.fromArchiveEntry(archive, 'io/spring/javaformat/checkstyle/checkstyle.xml')
def archive = configurations.checkstyle.filter { it.name.startsWith("spring-javaformat-checkstyle")}
config = resources.text.fromArchiveEntry(archive, "io/spring/javaformat/checkstyle/checkstyle.xml")
toolVersion = 8.11
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/settings.gradle
Expand Up @@ -5,7 +5,7 @@ pluginManagement {
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == 'io.spring.javaformat') {
if (requested.id.id == "io.spring.javaformat") {
useModule "io.spring.javaformat:spring-javaformat-gradle-plugin:${requested.version}"
}
}
Expand Down
6 changes: 3 additions & 3 deletions gradle/build-cache-settings.gradle
Expand Up @@ -4,9 +4,9 @@ buildCache {
}
remote(HttpBuildCache) {
enabled = true
url = 'https://ge.spring.io/cache/'
def cacheUsername = System.getenv('GRADLE_ENTERPRISE_CACHE_USERNAME')
def cachePassword = System.getenv('GRADLE_ENTERPRISE_CACHE_PASSWORD')
url = "https://ge.spring.io/cache/"
def cacheUsername = System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME")
def cachePassword = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
if (cacheUsername && cachePassword) {
push = true
credentials {
Expand Down
38 changes: 19 additions & 19 deletions gradle/build-scan-user-data.gradle
Expand Up @@ -5,57 +5,57 @@ tagCiOrLocal()
addGitMetadata()

void tagOs() {
gradleEnterprise.buildScan.tag System.getProperty('os.name')
gradleEnterprise.buildScan.tag System.getProperty("os.name")
}

void tagJdk() {
gradleEnterprise.buildScan.tag "JDK-${System.getProperty('java.specification.version')}"
gradleEnterprise.buildScan.tag "JDK-" + System.getProperty('java.specification.version')
}

void tagIde() {
if (System.getProperty('idea.version')) {
gradleEnterprise.buildScan.tag 'IntelliJ IDEA'
} else if (System.getProperty('eclipse.buildId')) {
gradleEnterprise.buildScan.tag 'Eclipse'
if (System.getProperty("idea.version")) {
gradleEnterprise.buildScan.tag "IntelliJ IDEA"
} else if (System.getProperty("eclipse.buildId")) {
gradleEnterprise.buildScan.tag "Eclipse"
}
}

void tagCiOrLocal() {
gradleEnterprise.buildScan.tag(isCi() ? 'CI' : 'LOCAL')
gradleEnterprise.buildScan.tag(isCi() ? "CI" : "LOCAL")
}

void addGitMetadata() {
gradleEnterprise.buildScan.background {
def gitCommitId = execAndGetStdout('git', 'rev-parse', '--short=8', '--verify', 'HEAD')
def gitCommitId = execAndGetStdout("git", "rev-parse", "--short=8", "--verify", "HEAD")
def gitBranchName = getBranch()
def gitStatus = execAndGetStdout('git', 'status', '--porcelain')
def gitStatus = execAndGetStdout("git", "status", "--porcelain")

if(gitCommitId) {
def commitIdLabel = 'Git Commit ID'
def commitIdLabel = "Git Commit ID"
value commitIdLabel, gitCommitId
link 'Git commit build scans', customValueSearchUrl([(commitIdLabel): gitCommitId])
link "Git commit build scans", customValueSearchUrl([(commitIdLabel): gitCommitId])
}
if (gitBranchName) {
tag gitBranchName
value 'Git branch', gitBranchName
value "Git branch", gitBranchName
}
if (gitStatus) {
tag 'dirty'
value 'Git status', gitStatus
tag "dirty"
value "Git status", gitStatus
}
}
}

boolean isCi() {
System.getenv('CI')
System.getenv("CI")
}

String getBranch() {
def branch = System.getenv('BRANCH')
def branch = System.getenv("BRANCH")
if (branch) {
return branch
}
return execAndGetStdout('git', 'rev-parse', '--abbrev-ref', 'HEAD')
return execAndGetStdout("git", "rev-parse", "--abbrev-ref", "HEAD")
}

String execAndGetStdout(String... args) {
Expand All @@ -70,11 +70,11 @@ String execAndGetStdout(String... args) {
String customValueSearchUrl(Map<String, String> search) {
def query = search.collect { name, value ->
"search.names=${encodeURL(name)}&search.values=${encodeURL(value)}"
}.join('&')
}.join("&")

"${gradleEnterprise.buildScan.server}/scans?${query}"
}

String encodeURL(String url) {
URLEncoder.encode(url, 'UTF-8')
URLEncoder.encode(url, "UTF-8")
}
68 changes: 34 additions & 34 deletions settings.gradle
Expand Up @@ -2,68 +2,68 @@ pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/snapshot' }
maven { url "https://repo.spring.io/snapshot" }
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == 'org.jetbrains.kotlin.jvm') {
if (requested.id.id == "org.jetbrains.kotlin.jvm") {
useVersion "${kotlinVersion}"
}
if (requested.id.id == 'org.jetbrains.kotlin.plugin.spring') {
if (requested.id.id == "org.jetbrains.kotlin.plugin.spring") {
useVersion "${kotlinVersion}"
}
}
}
}

plugins {
id 'com.gradle.enterprise' version '3.1.1'
id "com.gradle.enterprise" version "3.1.1"
}

apply from: "${rootDir}/gradle/build-scan-user-data.gradle"
gradleEnterprise {
buildScan {
captureTaskInputFiles = true
obfuscation {
ipAddresses { addresses -> addresses.collect { address -> '0.0.0.0'} }
ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0"} }
}
publishAlways()
publishIfAuthenticated()
server = 'https://ge.spring.io'
server = "https://ge.spring.io"
}
}

apply from: "${settingsDir}/gradle/build-cache-settings.gradle"

rootProject.name='spring-boot-build'
rootProject.name="spring-boot-build"

include 'spring-boot-project:spring-boot-dependencies'
include 'spring-boot-project:spring-boot-parent'
include 'spring-boot-project:spring-boot-tools:spring-boot-antlib'
include 'spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor'
include 'spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform'
include 'spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata'
include 'spring-boot-project:spring-boot-tools:spring-boot-configuration-processor'
include 'spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin'
include 'spring-boot-project:spring-boot-tools:spring-boot-layertools'
include 'spring-boot-project:spring-boot-tools:spring-boot-loader'
include 'spring-boot-project:spring-boot-tools:spring-boot-loader-tools'
include 'spring-boot-project:spring-boot-tools:spring-boot-maven-plugin'
include 'spring-boot-project:spring-boot-tools:spring-boot-test-support'
include 'spring-boot-project:spring-boot'
include 'spring-boot-project:spring-boot-autoconfigure'
include 'spring-boot-project:spring-boot-actuator'
include 'spring-boot-project:spring-boot-actuator-autoconfigure'
include 'spring-boot-project:spring-boot-cli'
include 'spring-boot-project:spring-boot-devtools'
include 'spring-boot-project:spring-boot-docs'
include 'spring-boot-project:spring-boot-properties-migrator'
include 'spring-boot-project:spring-boot-test'
include 'spring-boot-project:spring-boot-test-autoconfigure'
include 'spring-boot-tests:spring-boot-deployment-tests'
include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests'
include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests'
include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-server-tests'
include "spring-boot-project:spring-boot-dependencies"
include "spring-boot-project:spring-boot-parent"
include "spring-boot-project:spring-boot-tools:spring-boot-antlib"
include "spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor"
include "spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"
include "spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata"
include "spring-boot-project:spring-boot-tools:spring-boot-configuration-processor"
include "spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin"
include "spring-boot-project:spring-boot-tools:spring-boot-layertools"
include "spring-boot-project:spring-boot-tools:spring-boot-loader"
include "spring-boot-project:spring-boot-tools:spring-boot-loader-tools"
include "spring-boot-project:spring-boot-tools:spring-boot-maven-plugin"
include "spring-boot-project:spring-boot-tools:spring-boot-test-support"
include "spring-boot-project:spring-boot"
include "spring-boot-project:spring-boot-autoconfigure"
include "spring-boot-project:spring-boot-actuator"
include "spring-boot-project:spring-boot-actuator-autoconfigure"
include "spring-boot-project:spring-boot-cli"
include "spring-boot-project:spring-boot-devtools"
include "spring-boot-project:spring-boot-docs"
include "spring-boot-project:spring-boot-properties-migrator"
include "spring-boot-project:spring-boot-test"
include "spring-boot-project:spring-boot-test-autoconfigure"
include "spring-boot-tests:spring-boot-deployment-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests"
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-server-tests"

file("${rootDir}/spring-boot-project/spring-boot-starters").eachDirMatch(~/spring-boot-starter.*/) {
include "spring-boot-project:spring-boot-starters:${it.name}"
Expand Down

0 comments on commit 0209cd3

Please sign in to comment.