Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

Commit

Permalink
adjusted to be eligible for maven central release
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz.chojnacki committed Apr 13, 2017
1 parent accfa85 commit 3934690
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 87 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@
/.gradle/
/target/
/build/
*.iml
*.iml
/bin/
199 changes: 121 additions & 78 deletions build.gradle
@@ -1,79 +1,122 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()

maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
/* required for jar shadowing */
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3+'
}
}

repositories {
mavenLocal()
mavenCentral()
}

/* IDE projects generation */
apply plugin: 'eclipse'
apply plugin: 'idea'

/* java configuration */
apply plugin: 'java'

compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}

/* shadowJar */
apply plugin: 'com.github.johnrengelman.shadow'

configurations {
compileAndIncludeInJar
compile.extendsFrom(configurations.compileAndIncludeInJar)
}

shadowJar {
configurations = [ project.configurations.compileAndIncludeInJar ]
classifier = null
}

build.finalizedBy shadowJar

/* gradle plugin development configuration */
apply plugin: 'java-gradle-plugin'

gradlePlugin {
plugins {
simplePlugin {
id = pluginId
implementationClass = 'com.dynatrace.diagnostics.automation.gradle.GradleEntryPoint'
}
}
}

/* compile and testing dependencies */
dependencies {
compileAndIncludeInJar fileTree(dir: 'lib', include: '*.jar')
compile gradleApi()

testCompile gradleApi()
testCompile 'junit:junit:4.12'

/*
testCompile 'org.powermock:powermock-core:1.6.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.1'
testCompile 'org.powermock:powermock-api-mockito:1.6.1'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
*/
}

task wrapper(type: Wrapper) {
gradleVersion = '3.0'
buildscript {
repositories {
mavenLocal()
mavenCentral()

maven {
url "https://plugins.gradle.org/m2/"
}
}
}

repositories {
mavenLocal()
mavenCentral()
}

/* IDE projects generation */
apply plugin: 'eclipse'
apply plugin: 'idea'

/* java configuration */
apply plugin: 'java'

compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}


/* gradle plugin development configuration */
apply plugin: 'java-gradle-plugin'

gradlePlugin {
plugins {
simplePlugin {
id = pluginId
implementationClass = 'com.dynatrace.diagnostics.automation.gradle.GradleEntryPoint'
}
}
}

/** maven plugin for pom creation, installation */
apply plugin: 'maven'
/** signing of maven artifacts */
apply plugin: 'signing'

/** signing should be done only if executed with uploadArchives task,
* the 'required' property doesn't work so need to uncomment task to avoid failure in build*/
//signing {
// required { gradle.taskGraph.hasTask("uploadArchives") }
// sign configurations.archives
//}

/* compile and testing dependencies */
dependencies {
compile gradleApi()
compile 'com.dynatrace.sdk:server-rest-sdk:7.0.0'

testCompile gradleApi()
testCompile 'junit:junit:4.12'
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

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

artifacts {
archives javadocJar, sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Dynatrace Gradle Plugin'
packaging 'jar'
description 'The automation plugin enables automation of Dynatrace by leveraging the REST interfaces of the Dynatrace AppMon Server'
url 'https://github.com/Dynatrace/Dynatrace-Gradle-Plugin'

scm {
connection 'scm:git:https://github.com/Dynatrace/Dynatrace-Gradle-Plugin.git'
developerConnection 'scm:git:https://github.com/Dynatrace/Dynatrace-Gradle-Plugin.git'
url 'https://github.com/Dynatrace/Dynatrace-Gradle-Plugin'
}

licenses {
license {
name 'dynaTrace BSD'
url 'https://raw.githubusercontent.com/Dynatrace/Dynatrace-Gradle-Plugin/master/LICENSE'
}
}

developers {
developer {
name 'Tomasz Chojnacki'
email 'tomasz.chojnacki@dynatrace.com'
}
}
}
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Wed Aug 31 10:13:48 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
#Wed Apr 12 15:30:39 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip
Binary file removed lib/server-rest-sdk-7.0.0.jar
Binary file not shown.
Expand Up @@ -130,7 +130,6 @@ public DynatraceClient getDynatraceClient() throws BuildException {
* Used only for testing purposes
*
* @param client - user-defined {@link CloseableHttpClient}
* @return {@link DynatraceClient} with parameters provided in properties
* @throws BuildException whenever execution fails
*/
public void setDynatraceClientWithCustomHttpClient(CloseableHttpClient client) throws BuildException {
Expand Down
Expand Up @@ -120,7 +120,7 @@ public class DtStartTest extends DtServerProfileBase {
/**
* Used to add a custom property to the test meta data
*
* @param property
* @param property a custom property
*/
public void addCustomProperty(final CustomProperty property) {
properties.add(property);
Expand Down

0 comments on commit 3934690

Please sign in to comment.