Skip to content

Commit 1bf2fc6

Browse files
author
freds
committed
Provided a default init script for resolution setup
1 parent c2b84b2 commit 1bf2fc6

File tree

3 files changed

+70
-22
lines changed

3 files changed

+70
-22
lines changed

Diff for: README.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
* How to build
3+
gradle --init-script buildSrc/repo-init.gradle -S build
4+

Diff for: build-info-extractor-gradle/src/examples/multiproject/build.gradle

+22-22
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,33 @@
2525
*
2626
*/
2727

28-
/*apply {
29-
apply from: 'http://gradle.artifactoryonline.com/gradle/repo/artifactoryinitplugin/artifactoryinitplugin/1.0/artifactoryinitplugin-1.0-SNAPSHOT.gradle'
30-
}*/
28+
buildscript {
29+
repositories {
30+
mavenRepo name: 'build-plugins-repo', urls: "http://localhost:8081/artifactory/plugins-snapshot"
31+
}
32+
dependencies {
33+
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:1.0+'
34+
}
35+
}
3136

3237
allprojects {
33-
apply {
34-
apply plugin: 'maven'
35-
}
36-
group = 'org.gradle'
37-
version = '1.0'
38+
apply {
39+
apply plugin: 'maven'
40+
apply plugin: 'artifactoryplugin'
41+
}
42+
group = 'org.gradle'
43+
version = '1.0'
3844
}
3945

4046
subprojects {
41-
apply {
42-
apply plugin: 'java'
43-
}
44-
45-
dependencies {
46-
testCompile 'junit:junit:4.7'
47-
}
48-
manifest.mainAttributes(provider: 'gradle')
49-
}
50-
51-
task bla {
52-
{
53-
54-
}
47+
apply {
48+
apply plugin: 'java'
49+
}
50+
51+
dependencies {
52+
testCompile 'junit:junit:4.7'
53+
}
54+
manifest.mainAttributes(provider: 'gradle')
5555
}
5656

5757
dependsOnChildren()

Diff for: buildSrc/repo-init.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2010 JFrog Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
logger.debug("Applying Artifactory Gradle Settings")
18+
19+
addListener(new ArtifactoryGradleSettings())
20+
class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
21+
22+
def void projectsLoaded(Gradle gradle) {
23+
Project root = gradle.getRootProject()
24+
artifactoryRoot = 'http://repo.jfrog.org/artifactory'
25+
root.logger.debug("Applying Artifactory to project root ${root.name}")
26+
root.allprojects {
27+
buildscript {
28+
repositories {
29+
mavenRepo name: 'plugins-repo', urls: "$artifactoryRoot/gradle-plugins"
30+
}
31+
}
32+
repositories {
33+
mavenRepo name: 'libs-repo', urls: "$artifactoryRoot/gradle-libs"
34+
add(new org.apache.ivy.plugins.resolver.IvyRepResolver()) {
35+
name = 'gradle-ivy'
36+
ivyroot = "$artifactoryRoot/gradle-ivy"
37+
artroot = "$artifactoryRoot/gradle-ivy"
38+
ivypattern = '[organisation]/[module]/ivy-[revision].xml'
39+
artpattern = '[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]'
40+
}
41+
}
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)