forked from netzgut/integral-resteasy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
135 lines (112 loc) · 4.55 KB
/
build.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
135
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java'
id 'maven'
id 'nebula.provided-base' version '3.1.0'
id 'com.github.hierynomus.license' version '0.13.1'
}
group 'net.netzgut.integral'
version '0.0.1-SNAPSHOT'
description 'A ReastEasy 3.1.0 replacement for org.tynamo.tapestry-resteasy'
project.ext.inceptionYear = '2016'
project.ext.github = 'integral-resteasy'
project.ext.moduleClasses = 'net.netzgut.integral.resteasy.modules.ResteasyModule'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
jcenter()
mavenLocal()
}
project.ext.versions = [
// compile
slf4j: '1.7.24',
resteasy: '3.1.1.Final',
// provided
tapestry: '5.4.1',
servlet: '3.1.0'
]
dependencies {
compile "org.slf4j:slf4j-log4j12:${versions.slf4j}"
compile("org.jboss.resteasy:resteasy-jaxrs:${versions.resteasy}") {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
compile "org.jboss.resteasy:resteasy-jaxb-provider:${versions.resteasy}"
provided "org.apache.tapestry:tapestry-core:${versions.tapestry}"
provided "javax.servlet:javax.servlet-api:${versions.servlet}"
}
jar {
manifest { attributes 'Tapestry-Module-Classes': moduleClasses }
}
task wrapper(type: Wrapper) { gradleVersion = '3.4.1' }
task pom {
doLast {
pom {
packaging = 'jar'
project {
inceptionYear inceptionYear
name rootProject.name
description project.description
url "https://github.com/netzgut/$github"
properties { 'project.build.sourceEncoding' 'UTF-8' }
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url "https://github.com/netzgut/$github"
connection "scm:git:git://github.com/netzgut/${github}.git"
developerConnection "scm:git:[email protected]:netzgut/${github}.git"
}
}
}.withXml { xmlProvider ->
def plugins = xmlProvider.asNode().appendNode('build').appendNode('plugins')
def mavenCompilerPlugin = plugins.appendNode('plugin')
mavenCompilerPlugin.appendNode('artifactId').value = 'maven-compiler-plugin'
mavenCompilerPlugin.appendNode('version').value = '3.1'
def mavenCompilerPluginConfiguration = mavenCompilerPlugin.appendNode('configuration')
mavenCompilerPluginConfiguration.appendNode('source').value = sourceCompatibility
mavenCompilerPluginConfiguration.appendNode('target').value = targetCompatibility
def mavenSurefirePlugin = plugins.appendNode('plugin')
mavenSurefirePlugin.appendNode('artifactId').value = 'maven-surfire-plugin'
mavenSurefirePlugin.appendNode('version').value = '2.19.1'
mavenSurefirePlugin.appendNode('configuration')
def mavenJarPlugin = plugins.appendNode('plugin')
mavenJarPlugin.appendNode('artifactId').value = 'maven-jar-plugin'
def mavenJarPluginConfigurationManifest = mavenJarPlugin.appendNode('configuration').appendNode('archive').appendNode('manifestEntries')
mavenJarPluginConfigurationManifest.appendNode('Tapestry-Module-Classes').value = moduleClasses
}.writeTo('pom.xml')
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
uploadArchives {
// We need to set the variables if not present
ext.snapshot_repository = project.hasProperty('snapshot-repository') ? project.property('snapshot-repository') : ''
ext.snapshot_repository_username = project.hasProperty('snapshot-repository-username') ? project.property('snapshot-repository-username') : ''
ext.snapshot_repository_password = project.hasProperty('snapshot-repository-password') ? project.property('snapshot-repository-password') : ''
repositories {
mavenDeployer {
snapshotRepository(url: snapshot_repository) {
authentication(userName: snapshot_repository_username, password: snapshot_repository_password)
}
}
}
}
license {
header rootProject.file('src/main/resources/META-INF/LICENSE.txt')
strictCheck true
ext.year = Calendar.getInstance().get(Calendar.YEAR)
}