Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add distribution and shadow plugin. Finish with publishing to bintray.
  • Loading branch information
Arthur Zagretdinov authored and thekingn0thing committed Jan 25, 2017
1 parent b5c9d7e commit e7a20f6
Show file tree
Hide file tree
Showing 41 changed files with 701 additions and 1,721 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2007 PowerMock Contributors
Copyright 2007-2017 PowerMock Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
359 changes: 8 additions & 351 deletions build.gradle
Expand Up @@ -13,6 +13,7 @@ buildscript {
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'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}

Expand All @@ -37,7 +38,6 @@ ext{
eclipseJdt = "3.3.0-v_771"
}

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' +
Expand All @@ -47,362 +47,19 @@ description = 'PowerMock allows you to unit test code normally regarded as untes
' 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."

dependencies {
compile("org.objenesis:objenesis:${objenesisVersion}")
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
testCompile("cglib:cglib-nodep:${cglibVersion}")
}
}

project("powermock-core") {
description = "Various utilities for accessing internals of a class."

dependencies {
compile(project(":powermock-reflect"))
compile("org.javassist:javassist:${javassistVersion}")

testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")

testCompile("org.mockito:mockito-core:${mockito1Version}")
mockito2("org.mockito:mockito-core:${mockito2Version}")
}

check.dependsOn mockito2Test
}

project("powermock-api:powermock-api-support"){
description = "PowerMock API Utility classes."

dependencies {
compile(project(":powermock-reflect"))
compile(project(":powermock-core"))
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project("powermock-api:powermock-api-easymock"){
description = "PowerMock API for EasyMock."

dependencies {
compile(project(":powermock-api:powermock-api-support"))
compile("cglib:cglib-nodep:${cglibVersion}")
provided("org.easymock:easymock:${easymockVersion}")

testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project("powermock-api:powermock-api-mockito-common"){
description = "PowerMock API for Mockito. Common classes."

dependencies {
compile(project(":powermock-api:powermock-api-support"))

testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")

provided("org.mockito:mockito-core:${mockito1Version}")

mockito2(project(":powermock-api:powermock-api-support"))
mockito2("org.mockito:mockito-core:${mockito2Version}")
}
}

project("powermock-api:powermock-api-mockito"){
description = "PowerMock API for Mockito 1.+.."

sourceSets {
main {
compileClasspath = compileClasspath + configurations.provided;
runtimeClasspath = output + compileClasspath + configurations.provided
}
test {
compileClasspath = compileClasspath + configurations.provided + configurations.provided
runtimeClasspath = output + compileClasspath + configurations.provided
}
}

dependencies {
compile(project(":powermock-api:powermock-api-mockito-common"))
compile("org.mockito:mockito-core:${mockito1Version}")

testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")

}
}

project("powermock-api:powermock-api-mockito2"){
description = "PowerMock API for Mockito 2.+.."

sourceSets {
main {
compileClasspath = compileClasspath + configurations.provided
runtimeClasspath = output + compileClasspath + configurations.provided
}
test {
compileClasspath = compileClasspath + configurations.provided + configurations.provided
runtimeClasspath = output + compileClasspath + configurations.provided
}
}

dependencies {
compile(project(":powermock-api:powermock-api-mockito-common"))
compile("org.mockito:mockito-core:${mockito2Version}")

testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-classloading:powermock-classloading-base"){
description = "Utilities for loading and executing classes."

dependencies {
compile(project(":powermock-api:powermock-api-support"))
compile(project(":powermock-reflect"))
compile(project(":powermock-core"))
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-classloading:powermock-classloading-objenesis"){
description = "Performs classloader deep-cloning using Objenesis."

dependencies {
compile(project(":powermock-classloading:powermock-classloading-base"))
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-classloading:powermock-classloading-xstream"){
description = "Performs classloader deep-cloning using X-Stream."

dependencies {
compile(project(":powermock-classloading:powermock-classloading-base"))
compile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-modules:powermock-module-javaagent"){
description = "PowerMock Java agent support."

dependencies {
compile(project(":powermock-core"))
testCompile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}

jar {
manifest {
attributes(
"Manifest-Version": "1.0",
"Premain-Class": "org.powermock.modules.agent.PowerMockAgent",
"Agent-Class": "org.powermock.modules.agent.PowerMockAgent",
"Can-Retransform-Classes": true,
"Can-Redefine-Classes": true
)
}
}
}

project(":powermock-modules:powermock-module-junit3"){
description = "PowerMock support module for JUnit 3.x."

dependencies {
compile(project(":powermock-core")){
exclude group:'junit', module:'junit'
}
compile("junit:junit:3.8.2"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-modules:powermock-module-junit4-common"){
description = "PowerMock support module for all versions of JUnit 4.x."

dependencies {
compile(project(":powermock-reflect"))
compile(project(":powermock-core"))
compile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-modules:powermock-module-junit4"){
description = "PowerMock support module for JUnit 4.x."

dependencies {
compile(project(":powermock-modules:powermock-module-junit4-common"))
compile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
testCompile("org.easymock:easymock:${easymockVersion}")
}
}

project(":powermock-modules:powermock-module-junit4-legacy"){
description = "PowerMock support module for JUnit 4.0-4.3."

dependencies {
compile(project(":powermock-modules:powermock-module-junit4-common")){
exclude group:'junit', module:'junit'
}
compile("junit:junit:4.3"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}


project(":powermock-modules:powermock-module-junit4-rule"){
description = "PowerMock support module for JUnit 4.x rules."

dependencies {
compile(project(":powermock-core"))
compile(project(":powermock-modules:powermock-module-junit4-common"))

provided(project(":powermock-classloading:powermock-classloading-base"))

compile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}


project(":powermock-modules:powermock-module-junit4-rule-agent"){
description = "PowerMock support module for JUnit 4.x rules with Java agent"

dependencies {
compile(project(":powermock-core"))
compile(project(":powermock-modules:powermock-module-javaagent"))

compile("junit:junit:${junitVersion}"){
exclude group:'org.hamcrest', module:'hamcrest-core'
}
compile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-modules:powermock-module-testng-common"){
description = "PowerMock module for TestNG. Common classes"

dependencies {
compile(project(":powermock-reflect"))
compile(project(":powermock-core"))
compile("org.testng:testng:${testngVersion}")
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

project(":powermock-modules:powermock-module-testng"){
description = "PowerMock module for TestNG."
apply from: "${gradleScriptDir}/version.gradle"

dependencies {
compile(project(":powermock-core"))
compile(project(":powermock-modules:powermock-module-testng-common"))
compile("org.testng:testng:${testngVersion}")
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
allprojects{
apply plugin: 'propdeps-idea'
}

project(":powermock-modules:powermock-module-testng-agent"){
description = "PowerMock module for TestNG with using Javaagent."
apply from: "${gradleScriptDir}/modules.gradle"
apply from: "${gradleScriptDir}/release/release.gradle"

dependencies {
compile(project(":powermock-core"))
compile(project(":powermock-modules:powermock-module-testng-common"))
compile(project(":powermock-modules:powermock-module-javaagent"))
compile("org.testng:testng:${testngVersion}")
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
}

configure(publishableModules) { project ->
apply from: "${gradleScriptDir}/publish-maven.gradle"
apply from: "${gradleScriptDir}/publish.gradle"
jar{
enabled = false
}

apply from: "${gradleScriptDir}/release.gradle"

task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}

0 comments on commit e7a20f6

Please sign in to comment.