Skip to content

Commit 374ed18

Browse files
authored
Merge pull request #1182 from microsoft/littleaj/dependencies_lockfile
update build to generate lockfiles when prompted
2 parents c243b86 + 32d46ea commit 374ed18

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ task clean {
6363
}
6464

6565
allprojects {
66+
task generateLockfiles {
67+
doFirst {
68+
assert gradle.startParameter.writeDependencyLocks // meaning you must run with --write-locks parameter
69+
}
70+
doLast {
71+
configurations.findAll {
72+
it.canBeResolved
73+
}.each {
74+
it.resolve()
75+
}
76+
}
77+
}
78+
6679
tasks.withType(JavaCompile) {
6780
doFirst {
6881
logger.info("sourceCompatibility = $sourceCompatibility")

gradle/common-java.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ apply plugin: 'org.owasp.dependencycheck'
3333
sourceCompatibility = 1.7
3434
targetCompatibility = 1.7
3535

36+
configurations {
37+
compileClasspath.resolutionStrategy.activateDependencyLocking()
38+
runtimeClasspath.resolutionStrategy.activateDependencyLocking()
39+
}
40+
3641
checkstyle {
3742
toolVersion = '8.22'
3843
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")

0 commit comments

Comments
 (0)