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