Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (72 sloc) 2.19 KB
apply plugin:'groovy'
apply plugin:'maven'
apply plugin:'code-quality'
version = '0.8.2'
configurations {
deployerJars
}
configure(install.repositories.mavenInstaller) {
pom.project {
groupId 'com.smokejumperit'
artifactId 'gradle-plugins'
version project.version
}
}
ant.property(environment:'env')
if(!ant.properties['env.GRADLE_HOME']) throw new Exception('Please set $GRADLE_HOME')
repositories {
mavenCentral()
mavenRepo urls:'http://repo.smokejumperit.com'
}
dependencies {
groovy 'org.codehaus.groovy:groovy:1.8.0'
deployerJars "org.apache.maven.wagon:wagon-ssh:1.0-beta-6"
compile fileTree(
dir:System.getenv().get('GRADLE_HOME'),
includes:['**/*.jar']
)
}
processResources {
includes = excludes = []
include "**/*"
exclude "**/.gitignore"
}
jar {
includes = excludes = []
include "**/*"
exclude "**/.gitignore"
}
uploadArchives {
repositories.mavenDeployer {
def repoUser = System.properties['sjit.repo.user'] ?: "[NO USER: SET sjit.repo.user]"
configuration = configurations.deployerJars
repository(url: "scp://repo.smokejumperit.com/home/$repoUser/repo.smokejumperit.com/") {
authentication(
userName: repoUser,
privateKey: new File(System.properties['sjit.repo.keyFile'] ?: "[NO KEYFILE: set sjit.repo.keyFile]").absolutePath,
passphrase: System.properties['sjit.repo.passphrase'] ?: ""
)
pom {
groupId='com.smokejumperit'
artifactId='gradle-plugins'
version= project.version
}
}
}
}
//tasks.uploadArchives.dependsOn(tasks.codenarcMain)
task notePlugins << {
def names = []
sourceSets.main.allGroovy.matching {
include('**/com/smokejumperit/gradle/*Plugin.groovy')
exclude('**/SjitPlugin.groovy')
}.visit {
names << it.file.name.replaceFirst(/\.groovy$/, '')
}
def resourceDir = (sourceSets.main.resources.srcDirs as List)[0]
if(!resourceDir) throw new Exception("No resource directory found!")
['com', 'smokejumperit', 'gradle'].each { resourceDir = new File(resourceDir, it) }
resourceDir.mkdirs() // Does nothing if already exists: see API
new File(resourceDir, 'sjit.plugins').text = names.join("\n")
}
processResources.dependsOn(notePlugins)