Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 34ce93125e
Fetching contributors…

Cannot retrieve contributors at this time

file 150 lines (118 sloc) 3.716 kb
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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact

apply plugin: 'groovy'
apply plugin: 'signing'
apply plugin: 'project-report'

dependencies {
compile gradleApi()
groovy localGroovy()
}

apply plugin: 'maven'

configurations {
deployerJars
published.extendsFrom archives, signatures
}

repositories { mavenCentral() }

dependencies {
compile 'commons-lang:commons-lang:2.4'
testCompile 'junit:junit:4.8.2'
deployerJars 'org.apache.maven.wagon:wagon-webdav-jackrabbit:2.0'
}

group = 'org.zeroturnaround'
version = '1.0.2-SNAPSHOT'

targetCompatibility = "1.5"
sourceCompatibility = "1.5"

def pomFile = pom {
project {
name 'ZeroTurnaround JRebel Gradle plugin'
description 'ZeroTurnaround JRebel Gradle plugin'
url 'http://www.zeroturnaround.com/jrebel'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'IB'
name 'Igor Bljahhin'
email 'igor.bljahhin@zeroturnaround.com'
}
}
inceptionYear '2011'
scm {
url 'https://github.com/zeroturnaround/gradle-jrebel-plugin'
connection 'scm:git:git@github.com:zeroturnaround/gradle-jrebel-plugin.git'
developerConnection 'scm:git:git@github.com:zeroturnaround/gradle-jrebel-plugin.git'
}
}
}

uploadPublished {
repositories {
mavenDeployer {
configuration = configurations.deployerJars

repository(url: 'dav:http://repos.zeroturnaround.com/nexus/content/repositories/zt-public-releases/') {
authentication(userName: nexusReleasesUsername, password: nexusReleasesPassword)
}

snapshotRepository(url: 'dav:http://repos.zeroturnaround.com/nexus/content/repositories/zt-public-snapshots/') {
authentication(userName: nexusSnapshotsUsername, password: nexusSnapshotsPassword)
}

pom = pomFile
}
}

doFirst { bundle.execute() }
}

signing { sign configurations.archives }

task release( dependsOn: uploadPublished ) { description = 'Releases the plugin, sign artifacts and upload them to Nexus. The bundle with artifacts for Sonatype is included into release.' }

// Prepare bundle for Sonatype

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

class GeneratePomTask extends DefaultTask {
File destFile
}

task generatePom(type: GeneratePomTask) {
destFile = file("${buildDir}/generatedPoms/${project.name}-${project.version}.pom")

inputs.file project.buildFile
outputs.file destFile

doLast {
println "Generate POM into " + destFile

pomFile.writeTo(destFile)
}
}

task bundle( type: Zip, dependsOn: signArchives) {
description = 'Prepares the bundle with artifacts for Sonatype.'
classifier = 'bundle'

from('build/libs/') {
include 'gradle-jrebel-plugin-*.jar'
include 'gradle-jrebel-plugin-*.jar.asc'
}

from('build/generatedPoms/') {
include '*.pom'
include '*.pom.asc'
}

doFirst {
bundleFile = file("${buildDir}/distributions/${project.name}-${project.version}-bundle.zip")

println "Creating bundle ${bundleFile}"

configurations.add "publishBundle"
configurations.publishBundle.artifacts.add(new DefaultPublishArtifact("bundle", "zip", "zip", "bundle", new
Date(), bundleFile))
}
}

// Define list of artifacts

artifacts {
archives (generatePom.destFile) {
name 'pom'
type 'pom'
builtBy generatePom
}
archives jar
archives sourcesJar
archives javadocJar
}
Something went wrong with that request. Please try again.