forked from johndevs/gradle-vaadin-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (94 loc) · 3.15 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
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'idea'
repositories{
mavenCentral()
}
configurations {
deployerJars
}
dependencies {
compile gradleApi()
compile localGroovy()
deployerJars "org.apache.maven.wagon:wagon-ftp:1.0-beta-2"
compile 'org.eclipse.jetty.aggregate:jetty-all-server:8.1.10.v20130312'
}
defaultTasks 'jar'
group = "fi.jasoft.plugin"
version = project.hasProperty('BUILD_VERSION') ? getProperty('BUILD_VERSION') : 'SNAPSHOT-'+ new Date().format('yyyyMMdd')
archivesBaseName ='gradle-vaadin-plugin'
sourceCompatibility = 1.7
targetCompatibility = 1.7
uploadArchives {
repositories.mavenDeployer {
def repo = System.getProperty('PLUGIN_MAVEN_REPOSITORY', '<plugin repository not defined>')
def user = System.getProperty('PLUGIN_MAVEN_REPOSITORY_USER', '<user not defined>')
def password = System.getProperty('PLUGIN_MAVEN_REPOSITORY_PASSWORD', '<password not defined>')
name = 'sshDeployer'
configuration = configurations.deployerJars
repository(url: repo) {
authentication(userName: user, password: password)
}
pom.project {
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
pom.scopeMappings.mappings.remove(configurations.compile)
}
}
// Use wrapper
task wrapper(type: Wrapper) { gradleVersion = '1.6' }
// Create pom.xml for Vaadin Directory
task createPOMforVaadinDirectory {
File pomDir = new File("src/main/resources/META-INF/maven/${project.group}/${project.archivesBaseName}")
pomDir.mkdirs()
File pomFile = new File(pomDir.canonicalPath+'/pom.xml')
outputs.file pomFile
pom {
artifactId = project.archivesBaseName
project {
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
repositories {
repository {
name 'Jasoft.fi Repository'
url 'http://mvn.jasoft.fi/maven2'
}
}
}
}.writeTo(pomFile.canonicalPath)
}
processResources {
// Create pom.xml for Vaadin directory
dependsOn project.createPOMforVaadinDirectory
// Apply build properties
def debugDir = project.file(".").getAbsolutePath()+'/build/libs'
from(sourceSets.main.resources.srcDirs){
filter(ReplaceTokens, tokens: [
version: project.version,
debugdir: debugDir
])
}
}
jar {
manifest{
attributes(
'Vaadin-Package-Version': 1,
'Vaadin-License-Title': 'Apache 2.0',
'Implementation-Title': 'Vaadin Plugin for Gradle',
'Implementation-Version': version,
'Implementation-Vendor': 'John Ahlroos',
)
}
}