Permalink
Browse files

Add publishing to bintray/maven

  • Loading branch information...
1 parent e82e7f2 commit 8c774feb2dd2b112a4344370d14eeb016d255e22 @thekingnothing thekingnothing committed with thekingnothing Jan 21, 2017
View
@@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright [yyyy] [name of copyright owner]
+ Copyright 2007 PowerMock Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
@@ -1,28 +1,24 @@
buildscript {
repositories {
mavenCentral()
- maven { url 'http://repo.spring.io/plugins-release' }
+ jcenter()
+ maven {
+ url 'http://repo.spring.io/plugins-release'
+ }
+ maven {
+ url 'https://plugins.gradle.org/m2/'
+ }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
+ classpath 'net.researchgate:gradle-release:2.4.0'
}
}
ext{
gradleScriptDir = "${rootProject.projectDir}/gradle"
-}
-
-apply from: "${gradleScriptDir}/version.gradle"
-
-description = 'PowerMock allows you to unit test code normally regarded as untestable.\n' +
- ' For instance it is possible to mock static methods, remove static initializers, allow mocking without dependency\n' +
- ' injection and more.\n' +
- ' PowerMock works by bytecode manipulation.\n' +
- ' PowerMock also contain some utilities that gives you easier access to an objects internal state.\n' +
- ' PowerMock can be used to test otherwise untestable code and also to achieve a cleaner separation between test\n' +
- ' and production code.'
-ext{
easymockVersion = "3.4"
hamcrestVersion = "1.3"
assertjVersion = "2.6.0"
@@ -41,8 +37,32 @@ ext{
eclipseJdt = "3.3.0-v_771"
}
-apply from: "${gradleScriptDir}/modules.gradle"
-apply from: "${gradleScriptDir}/mockito.gradle"
+apply from: "${gradleScriptDir}/version.gradle"
+
+description = 'PowerMock allows you to unit test code normally regarded as untestable.\n' +
+ ' For instance it is possible to mock static methods, remove static initializers, allow mocking without dependency\n' +
+ ' injection and more.\n' +
+ ' PowerMock works by bytecode manipulation.\n' +
+ ' PowerMock also contain some utilities that gives you easier access to an objects internal state.\n' +
+ ' PowerMock can be used to test otherwise untestable code and also to achieve a cleaner separation between test\n' +
+ ' and production code.'
+
+def publishableModules = allprojects - project(":powermock-api") - project(":powermock-classloading") - project(":powermock-modules") - project(":tests") - project(":tests").subprojects
+
+configure(publishableModules) { project ->
+ apply from: "${gradleScriptDir}/publishable-module.gradle"
+}
+
+def mockitoDependsModules = [
+ project(":powermock-core"),
+ project(":powermock-api:powermock-api-mockito-common"),
+ project(":powermock-api:powermock-api-mockito"),
+ project(":powermock-api:powermock-api-mockito2"),
+]
+
+configure(mockitoDependsModules) { project ->
+ apply from: "${gradleScriptDir}/mockito-module.gradle"
+}
project("powermock-reflect") {
description = "Various utilities for accessing internals of a class."
@@ -376,6 +396,12 @@ project(":powermock-modules:powermock-module-testng-agent"){
}
}
+configure(publishableModules) { project ->
+ //apply from: "${gradleScriptDir}/release.gradle"
+ apply from: "${gradleScriptDir}/publish-maven.gradle"
+ apply from: "${gradleScriptDir}/publish.gradle"
+}
+
task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}
@@ -0,0 +1,18 @@
+repositories {
+ mavenCentral()
+ jcenter()
+}
+
+group = "org.powermock"
+
+apply plugin: 'propdeps'
+apply plugin: 'propdeps-maven'
+apply plugin: 'propdeps-idea'
+apply plugin: 'java'
+
+targetCompatibility = 1.6
+sourceCompatibility = 1.6
+
+tasks.withType(JavaCompile) {
+ options.warnings = false
+}
@@ -0,0 +1,51 @@
+configurations {
+ mockito2
+}
+
+sourceSets {
+ main {
+ compileClasspath = compileClasspath + configurations.provided
+ }
+ test {
+ compileClasspath = compileClasspath + configurations.provided
+ }
+ mainMockito2 {
+ java.srcDirs = ['src/main/java']
+ resources.srcDirs = ['src/main/resources']
+ output.resourcesDir = 'build/classes/mockito2'
+ output.classesDir = 'build/classes/mockito2'
+ compileClasspath = sourceSets.main.compileClasspath + configurations.mockito2 + configurations.provided
+ runtimeClasspath = output + compileClasspath + configurations.mockito2
+ sourceCompatibility = 1.6
+ targetCompatibility = 1.6
+ }
+ testMockito2 {
+ java.srcDirs = ['src/test']
+ resources.srcDirs = ['src/test/resources']
+ output.resourcesDir = 'build/classes/testmockito2'
+ output.classesDir = 'build/classes/testmockito2'
+ compileClasspath = sourceSets.test.compileClasspath + configurations.mockito2 + configurations.provided
+ runtimeClasspath = output + compileClasspath + configurations.mockito2
+ sourceCompatibility = 1.6
+ targetCompatibility = 1.6
+ }
+}
+
+task mockito2Test(type: Test) {
+ description = 'Runs the test with Mockito 2'
+ group = 'verification'
+ testClassesDir = sourceSets.testMockito2.output.classesDir
+ classpath = sourceSets.testMockito2.runtimeClasspath
+
+ scanForTestClasses = false
+ include(["**/*Tests.class", "**/*Test.class"])
+ // Since we set scanForTestClasses to false, we need to filter out inner
+ // classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
+ // run MyTests by itself will fail if MyTests contains any inner classes.
+ exclude(["**/Abstract*.class", '**/*$*'])
+
+ reports.junitXml.destination = 'build/mockito2-test-results'
+ reports.html.destination = 'build/reports/mockito2Test'
+}
+
+mockito2Test.mustRunAfter test
View
@@ -1,60 +0,0 @@
-def mockitoDependsModules = [
- project(":powermock-core"),
- project(":powermock-api:powermock-api-mockito-common"),
- project("powermock-api:powermock-api-mockito"),
- project("powermock-api:powermock-api-mockito2"),
-]
-
-mockitoDependsModules += project(":tests:mockito").subprojects
-mockitoDependsModules += project(":tests:java8").subprojects
-
-configure(mockitoDependsModules){ project ->
- sourceSets {
- main {
- compileClasspath = compileClasspath + configurations.provided
- }
- test {
- compileClasspath = compileClasspath + configurations.provided
- }
- mainMockito2 {
- java.srcDirs = ['src/main/java']
- resources.srcDirs = ['src/main/resources']
- output.resourcesDir = 'build/classes/mockito2'
- output.classesDir = 'build/classes/mockito2'
- compileClasspath = sourceSets.main.compileClasspath + configurations.mockito2 + configurations.provided
- runtimeClasspath = output + compileClasspath + configurations.mockito2
- sourceCompatibility = 1.6
- targetCompatibility = 1.6
- }
- testMockito2 {
- java.srcDirs = ['src/test']
- resources.srcDirs = ['src/test/resources']
- output.resourcesDir = 'build/classes/testmockito2'
- output.classesDir = 'build/classes/testmockito2'
- compileClasspath = sourceSets.test.compileClasspath + configurations.mockito2 + configurations.provided
- runtimeClasspath = output + compileClasspath + configurations.mockito2
- sourceCompatibility = 1.6
- targetCompatibility = 1.6
- }
- }
-
- task mockito2Test(type: Test) {
- description = 'Runs the test with Mockito 2'
- group = 'verification'
- testClassesDir = sourceSets.testMockito2.output.classesDir
- classpath = sourceSets.testMockito2.runtimeClasspath
-
- scanForTestClasses = false
- include(["**/*Tests.class", "**/*Test.class"])
- // Since we set scanForTestClasses to false, we need to filter out inner
- // classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
- // run MyTests by itself will fail if MyTests contains any inner classes.
- exclude(["**/Abstract*.class", '**/*$*'])
-
- reports.junitXml.destination = 'build/mockito2-test-results'
- reports.html.destination = 'build/reports/mockito2Test'
- }
-
- mockito2Test.mustRunAfter test
-
-}
View
@@ -1,78 +0,0 @@
-def modules = allprojects - project(":powermock-api") - project(":powermock-classloading") - project(":powermock-modules") - project(":tests") - project(":tests:easymock")
-
-configure(modules){project ->
- repositories {
- mavenCentral()
- }
-
- group = "org.powermock"
-
- apply plugin: 'propdeps'
- apply plugin: 'propdeps-maven'
- apply plugin: 'propdeps-idea'
- apply plugin: "java"
-
- apply from: "${gradleScriptDir}/publish-maven.gradle"
-
- configurations {
- mockito2
- }
-
- compileJava {
- sourceCompatibility = 1.6
- targetCompatibility = 1.6
- }
-
- compileTestJava {
- sourceCompatibility = 1.6
- targetCompatibility = 1.6
- }
-
- tasks.withType(JavaCompile) {
- options.warnings = false
- }
-
- jar {
- manifest.attributes["Created-By"] =
- "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
- manifest.attributes["Implementation-Title"] = project.name
- manifest.attributes["Implementation-Version"] = project.version
-
- from("${rootProject.projectDir}") {
- include "LICENSE.txt"
- into "META-INF"
- expand(copyright: new Date().format("yyyy"), version: project.version)
- }
- }
-
- javadoc {
- description = "Generates project-level javadoc for use in -javadoc jar"
-
- options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
- options.author = true
- options.header = project.name
- options.addStringOption('-quiet')
-
- failOnError = false
-
- // Suppress warnings due to cross-module @see and @link references.
- // Note that global 'api' task does display all warnings.
- //logging.captureStandardError LogLevel.INFO
- //logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
- }
-
- task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
- }
-
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
-
- artifacts {
- archives sourcesJar
- archives javadocJar
- }
-}
Oops, something went wrong.

0 comments on commit 8c774fe

Please sign in to comment.