1apply plugin: 'java' 2 3configurations { 4 // similar to 'default', export compile-time dependencies 5 host.extendsFrom(hostCompile) 6 target.extendsFrom(targetCompile) 7} 8 9sourceSets { 10 host { 11 java { 12 srcDirs = ['src', 'cglib-and-asm/src'] 13 } 14 } 15 16 target { 17 java { 18 srcDirs = ['src'] 19 exclude 'org/mockito/internal/creation/cglib/**', 20 'org/mockito/internal/creation/jmock/**', 21 'org/mockito/internal/creation/AbstractMockitoMethodProxy.java', 22 'org/mockito/internal/creation/AcrossJVMSerializationFeature.java', 23 'org/mockito/internal/creation/CglibMockMaker.java', 24 'org/mockito/internal/creation/DelegatingMockitoMethodProxy.java', 25 'org/mockito/internal/creation/MethodInterceptorFilter.java', 26 'org/mockito/internal/creation/MockitoMethodProxy.java', 27 'org/mockito/internal/creation/SerializableMockitoMethodProxy.java', 28 'org/mockito/internal/invocation/realmethod/FilteredCGLIBProxyRealMethod.java', 29 'org/mockito/internal/invocation/realmethod/CGLIBProxyRealMethod.java', 30 'org/mockito/internal/invocation/realmethod/HasCGLIBMethodProxy.java' 31 } 32 } 33} 34 35dependencies { 36 targetCompile project(':hamcrest') 37 targetCompile project(':objenesis') 38 targetCompile project(path: ':junit', configuration: 'target') 39 40 hostCompile project(':hamcrest') 41 hostCompile project(':objenesis') 42 hostCompile project(path: ':junit', configuration: 'host') 43 hostCompile 'org.apache.ant:ant:1.8.0' 44} 45 46task targetJar(type: Jar) { 47 from sourceSets.target.output 48 dependsOn targetClasses 49 baseName "mockito" 50 classifier "target" 51} 52 53task hostJar(type: Jar) { 54 from sourceSets.host.output 55 dependsOn hostClasses 56 baseName "mockito" 57 classifier "host" 58} 59 60artifacts { 61 host hostJar 62 target targetJar 63} 64