This repository has been archived by the owner on Feb 3, 2025. It is now read-only.
forked from akhikhl/gretty
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.gradle
134 lines (111 loc) · 2.9 KB
/
common.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// include this file in subprojects:
// apply from: rootProject.file('libs/common.gradle')
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
repositories {
maven {
url "file:$privateRepoDir"
}
mavenCentral()
}
group = rootProject.group
version = rootProject.version
afterEvaluate {
dependencies {
testCompile "org.codehaus.groovy:groovy-all:${groovy_version}"
testCompile "org.spockframework:spock-core:${spock_version}"
}
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates sources jar') {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, description: 'Creates javadoc jar') {
dependsOn javadoc
classifier = 'javadoc'
from javadoc.destinationDir
if(tasks.findByName('groovydoc')) {
dependsOn groovydoc
from groovydoc.destinationDir
}
}
artifacts {
archives sourcesJar, javadocJar
}
def thisProject = project
def configurePom = {
resolveStrategy = Closure.DELEGATE_FIRST
packaging 'jar'
description thisProject.description
url thisProject.project_website
scm {
url thisProject.project_scm
connection thisProject.project_scm
developerConnection thisProject.project_scm
}
licenses {
license {
name thisProject.license
url thisProject.license_url
distribution 'repo'
}
}
developers {
developer {
id thisProject.developerId
name thisProject.developerName
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom.withXml {
asNode().children().last() + configurePom
}
artifact tasks.sourcesJar
artifact tasks.javadocJar
}
}
repositories {
maven {
name 'private'
url "file:/${project.rootProject.ext.privateRepoDir}"
}
}
}
install.repositories.mavenInstaller.pom*.whenConfigured { pom ->
pom.project {
name thisProject.name
configurePom.rehydrate(delegate, owner, thisObject).call()
}
}
project.task('publishToPrivateRepository') {
dependsOn "publishMavenJavaPublicationToPrivateRepository"
}
project.tasks.build.dependsOn project.tasks.publishToPrivateRepository
rootProject.tasks.buildIntegrationTests.dependsOn project.tasks.publishToPrivateRepository
rootProject.tasks.testAllIntegrationTests.dependsOn project.tasks.publishToPrivateRepository
// pkg {
// repo = 'maven'
// name = "${thisProject.projectId}-fork"
// desc = thisProject.description
// licenses = [ 'MIT' ]
// vcsUrl = thisProject.vcs_url
// labels = thisProject.projectLabels.split(',')
// }
// dryRun = thisProject.bintrayDryRun
// publish = true
} // afterEvaluate
publishing {
repositories {
maven {
name = 'unidata-3rdparty-releases'
url = 'https://artifacts.unidata.ucar.edu/repository/unidata-3rdparty/'
// Set credentials in taskGraph.whenReady {}
}
}
}