Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
130 lines (112 sloc) 3.4 KB
/*
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/";
}
}
Jump to Line
Something went wrong with that request. Please try again.