forked from yui/2in3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (112 loc) · 3.4 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
/*
This script expects you to have YUI3 expanded in "./yui"
*/
def yVersions = [] as Set; // version of YUI2 that we are packaging
dependsOnChildren()
subprojects {
apply plugin:"java"
apply plugin:"maven"
apply plugin:"signing"
baseName = project.name.split("/")[-1] // baseName is something like 2.5.0-base
tokens = baseName.split("-",2);
yVersions << tokens[0]
group="org.kohsuke.stapler"
version=tokens[0]+"-1";
description="YUI2 in 3";
repositories {
mavenCentral()
}
signing {
sign configurations.archives
}
// dummy source/javadoc jars to make central happy
task emptySourceJar(type:Jar) {
classifier = "sources"
}
task emptyJavadocJar(type:Jar) {
classifier = "javadoc"
}
artifacts {
archives (emptySourceJar) {
classifier = "sources";
}
archives (emptyJavadocJar) {
classifier = "javadoc"
}
}
p = project
customizePom = {
pom {
artifactId = "yui2in3-${tokens[1]}"
name = "YUI3 ${baseName}"
project {
description = p.description
url = "http://kohsuke.org/";
licenses {
license {
name = "BSD License"
url = "http://yuilibrary.com/license/"
}
}
developers {
developer {
id = "kohsuke"
}
}
scm {
// url = "http://github.com/kohsuke/package-renamed-asm";
}
}
}
}
install.repositories.mavenInstaller(customizePom)
uploadArchives.repositories.mavenDeployer(customizePom)
uploadArchives.repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/", id:"sonatype-nexus-staging") {
authentication(userName:"kohsuke", password:System.getProperty("password"))
}
}
}
yVersions.each { v -> // v is something like "1.2.3"
// list up *.js that has corresponding "*-min.js"
def regularJs = [] as Set
def yuiDir = new File("2in3/dist/${v}/build")
yuiDir.eachFileRecurse { f ->
if (f.name.endsWith(".js")) {
g = new File(f.path[0..-4]+"-min.js")
if (g.exists())
regularJs << f.path.substring(yuiDir.path.length()+1)
}
}
yuiProject = { name,dep,config ->
project(":modules/"+name) {
jar {
from("../../"+yuiDir.path,config)
into("yui3/")
includeEmptyDirs = false
}
dep.each { d ->
dependsOn ":modules/${v}-${d}"
dependencies {
compile "${group}:yui2in3-${d}:${version}"
}
}
}
}
// minified js and other base assets
yuiProject("${v}-base",[]) {
include "**/*";
exclude "**/*-debug.js";
exclude "**/skins/";
exclude regularJs;
}
def deps = ["base"];
// debug version of scripts
yuiProject("${v}-debug",deps) {
include "**/*-debug.js";
}
yuiProject("${v}-skin-sam",deps) {
include "**/skins/sam/";
}
}