"io.spring.dependency-management", | "io.spring.dependency-management", | ||||
"com.jfrog.artifactory", | "com.jfrog.artifactory", | ||||
"org.ajoberstar.grgit", | "org.ajoberstar.grgit", | ||||
"com.github.ben-manes.versions", | |||||
"com.bmuschko.docker-remote-api", | "com.bmuschko.docker-remote-api", | ||||
"com.github.hierynomus.license", | "com.github.hierynomus.license", | ||||
"com.github.hierynomus.license-report", | "com.github.hierynomus.license-report", |
| ./gradlew command | Description | | | ./gradlew command | Description | | ||||
|---|---| | |---|---| | ||||
| `dependencies`| list dependencies | | | `dependencies`| list dependencies | | ||||
| `dependencyCheckAnalyze` | list vulnerable dependencies | | |||||
| `dependencyUpdates` | list the dependencies that could be updated | | |||||
| `licenseFormat --rerun-tasks` | fix source headers by applying HEADER.txt | | | `licenseFormat --rerun-tasks` | fix source headers by applying HEADER.txt | | ||||
| `wrapper --gradle-version 5.2.1` | upgrade wrapper | | | `wrapper --gradle-version 5.2.1` | upgrade wrapper | | ||||
plugins { | plugins { | ||||
// Ordered alphabeticly | // Ordered alphabeticly | ||||
id 'com.github.ben-manes.versions' version '0.39.0' | |||||
id 'com.github.hierynomus.license' version '0.15.0' | id 'com.github.hierynomus.license' version '0.15.0' | ||||
id "com.github.hierynomus.license-report" version "0.15.0" apply false | id "com.github.hierynomus.license-report" version "0.15.0" apply false | ||||
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false | id 'com.github.johnrengelman.shadow' version '5.2.0' apply false | ||||
} | } | ||||
} | } | ||||
// https://github.com/ben-manes/gradle-versions-plugin | |||||
apply plugin: 'com.github.ben-manes.versions' | |||||
dependencyUpdates { | |||||
rejectVersionIf { | |||||
// Exclude dev versions from the list of dependency upgrades, for | |||||
// example to replace: | |||||
// org.slf4j:log4j-over-slf4j [1.7.25 -> 1.8.0-beta4] | |||||
// by | |||||
// org.slf4j:log4j-over-slf4j [1.7.25 -> 1.7.26] | |||||
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'jre12'].any { qualifier -> | |||||
it.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ | |||||
} | |||||
// Exclude upgrades on new major versions : | |||||
// com.hazelcast:hazelcast [3.12.3 -> 4.0.0] | |||||
rejected |= !it.candidate.version.substring(0, 2).equals(it.currentVersion.substring(0, 2)) | |||||
rejected | |||||
} | |||||
} | |||||
gradle.projectsEvaluated { gradle -> | gradle.projectsEvaluated { gradle -> | ||||
// yarn_run tasks can't all run in parallel without random issues | // yarn_run tasks can't all run in parallel without random issues | ||||
// this script ensure all yarn_run tasks run sequentially | // this script ensure all yarn_run tasks run sequentially |
commandLine osAdaptiveCommand(['npm', 'run', 'validate-ci']) | commandLine osAdaptiveCommand(['npm', 'run', 'validate-ci']) | ||||
} | } | ||||
// Check for known vulnerabilities | |||||
task dependency_audit(type: Exec) { | |||||
inputs.file('package.json') | |||||
outputs.cacheIf { false } | |||||
ignoreExitValue = true | |||||
commandLine osAdaptiveCommand(['npm', 'run', 'audit-ci']) | |||||
} | |||||
task zip(type: Zip) { | task zip(type: Zip) { | ||||
def archiveDir = "$version" | def archiveDir = "$version" | ||||
duplicatesStrategy DuplicatesStrategy.EXCLUDE | duplicatesStrategy DuplicatesStrategy.EXCLUDE |
"ts-check": "tsc --noEmit", | "ts-check": "tsc --noEmit", | ||||
"validate": "yarn lint && yarn ts-check && yarn format-check && yarn test", | "validate": "yarn lint && yarn ts-check && yarn format-check && yarn test", | ||||
"validate-ci": "yarn install --immutable && yarn test --ci", | "validate-ci": "yarn install --immutable && yarn test --ci", | ||||
"check-ci": "yarn install --immutable && yarn ts-check && yarn format-check", | |||||
"audit-ci": "yarn npm audit --environment production --severity high" | |||||
"check-ci": "yarn install --immutable && yarn ts-check && yarn format-check" | |||||
}, | }, | ||||
"prettier": { | "prettier": { | ||||
"jsxBracketSameLine": true, | "jsxBracketSameLine": true, |
commandLine osAdaptiveCommand(['npm', 'run', 'check-ci']) | commandLine osAdaptiveCommand(['npm', 'run', 'check-ci']) | ||||
} | } | ||||
// Check for known vulnerabilities | |||||
task dependency_audit(type: Exec) { | |||||
inputs.file('package.json') | |||||
outputs.cacheIf { false } | |||||
ignoreExitValue = true | |||||
commandLine osAdaptiveCommand(['npm', 'run', 'audit-ci']) | |||||
} | |||||
def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config") + fileTree(dir: "__mocks__") | def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config") + fileTree(dir: "__mocks__") | ||||
task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) { | task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) { |
"validate": "yarn lint && yarn ts-check && yarn format-check && yarn test", | "validate": "yarn lint && yarn ts-check && yarn format-check && yarn test", | ||||
"validate-ci": "yarn install --immutable && yarn test --coverage --ci", | "validate-ci": "yarn install --immutable && yarn test --coverage --ci", | ||||
"check-ci": "yarn install --immutable && yarn ts-check && yarn format-check", | "check-ci": "yarn install --immutable && yarn ts-check && yarn format-check", | ||||
"precommit": "yarn ts-check && lint-staged", | |||||
"audit-ci": "yarn npm audit --environment production --severity high" | |||||
"precommit": "yarn ts-check && lint-staged" | |||||
}, | }, | ||||
"engines": { | "engines": { | ||||
"node": ">=8" | "node": ">=8" |