Justin Morey | c5c1c31 | 2014-03-05 13:06:08 -0600 | [diff] [blame] | 1 | apply plugin: 'java' |
| 2 | |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 3 | configurations { |
Justin Morey | 98bbbe8 | 2014-06-11 11:33:37 -0500 | [diff] [blame] | 4 | // similar to 'default', export compile-time dependencies |
| 5 | host.extendsFrom(hostCompile) |
| 6 | target.extendsFrom(targetCompile) |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 7 | } |
| 8 | |
Justin Morey | c5c1c31 | 2014-03-05 13:06:08 -0600 | [diff] [blame] | 9 | sourceSets { |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 10 | host { |
| 11 | java { |
| 12 | srcDirs = ['src'] |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | target { |
Justin Morey | c5c1c31 | 2014-03-05 13:06:08 -0600 | [diff] [blame] | 17 | java { |
| 18 | srcDirs = ['src'] |
| 19 | include 'org/**', |
| 20 | 'junit/extensions/**', |
Brett Chabot | cdf692b | 2014-04-30 22:54:01 -0700 | [diff] [blame] | 21 | // remove these packages since they are in android.test.runner |
| 22 | // and proguard complains if they are present |
| 23 | // 'junit/runner/**', |
| 24 | // 'junit/textui/**', |
Justin Morey | c5c1c31 | 2014-03-05 13:06:08 -0600 | [diff] [blame] | 25 | 'junit/framework/ComparisonCompactor.java', |
| 26 | 'junit/framework/JUnit4TestAdapterCache.java', |
| 27 | 'junit/framework/JUnit4TestAdapter.java', |
| 28 | 'junit/framework/JUnit4TestCaseFacade.java' |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 33 | dependencies { |
| 34 | targetCompile getAndroidPrebuilt('4') |
| 35 | targetCompile project(':hamcrest') |
Justin Morey | 98bbbe8 | 2014-06-11 11:33:37 -0500 | [diff] [blame] | 36 | |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 37 | hostCompile project(':hamcrest') |
Justin Morey | c5c1c31 | 2014-03-05 13:06:08 -0600 | [diff] [blame] | 38 | } |
| 39 | |
Jon Boekenoogen | d3b82cd | 2014-05-01 18:17:51 -0700 | [diff] [blame] | 40 | task targetJar(type: Jar) { |
| 41 | from sourceSets.target.output |
| 42 | dependsOn targetClasses |
| 43 | baseName "junit4" |
| 44 | classifier "target" |
| 45 | } |
| 46 | |
| 47 | task hostJar(type: Jar) { |
| 48 | from sourceSets.host.output |
| 49 | dependsOn hostClasses |
| 50 | baseName "junit4" |
| 51 | classifier "host" |
| 52 | } |
| 53 | |
| 54 | artifacts { |
| 55 | host hostJar |
| 56 | target targetJar |
Brett Chabot | cdf692b | 2014-04-30 22:54:01 -0700 | [diff] [blame] | 57 | } |