1414 * limitations under the License.
1515 */
1616
17+ import gradle.Config
18+
1719apply plugin : ' com.android.library'
1820apply plugin : ' com.novoda.bintray-release'
1921
20- buildscript {
21- repositories {
22- jcenter()
23- }
24- dependencies {
25- classpath ' com.novoda:bintray-release:0.5.0'
26- }
27- }
28-
2922android {
30- compileSdkVersion 25
31- buildToolsVersion " 25.0.3"
23+ compileSdkVersion Config . COMPILE_SDK
3224
3325 defaultConfig {
34- minSdkVersion 9
35- targetSdkVersion 25
36- versionCode 1
37- versionName " 1.2.3 "
26+ minSdkVersion Config . MIN_SDK
27+ targetSdkVersion Config . TARGET_SDK
28+ versionCode Config . VERSION_CODE
29+ versionName Config . VERSION_NAME
3830
3931 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
4032 }
@@ -47,56 +39,74 @@ android {
4739}
4840
4941dependencies {
50- compile project(' :multi-view-adapter' )
51- provided(' com.android.databinding:library:1.3.1' ) {
42+ implementation project(' :multi-view-adapter' )
43+ implementation Config . RECYCLER_VIEW
44+
45+ compileOnly(' com.android.databinding:library:1.3.1' ) {
5246 transitive = false
5347 }
54- provided (' com.android.databinding:baseLibrary:2.3.2' ) {
48+ compileOnly (' com.android.databinding:baseLibrary:2.3.2' ) {
5549 transitive = false
5650 }
5751}
5852
5953publish {
60- userOrg = ' devahamed '
61- groupId = ' com.github.devahamed '
62- artifactId = ' multi-view-adapter-databinding '
63- publishVersion = ' 1.2.3 '
64- repoName = ' MultiViewAdapter '
65- desc = ' Additional DataBinding support for MultiViewAdapter '
66- website = ' https://github.com/DevAhamed/MultiViewAdapter '
54+ userOrg = Config . USER_ORG
55+ groupId = Config . GROUP_ID
56+ artifactId = Config . ARTIFACT_ID_DATA_BINDING
57+ publishVersion = Config . PUBLISH_VERSION
58+ repoName = Config . REPO_NAME
59+ desc = Config . DESC
60+ website = Config . WEBSITE
6761}
6862
69- if (project. hasProperty(" android" )) {
70- // Android libraries
71- task sourcesJar(type : Jar ) {
72- classifier = ' sources'
73- from android. sourceSets. main. java. srcDirs
74- }
63+ afterEvaluate { project ->
7564
76- task javadoc(type : Javadoc ) {
77- source = android. sourceSets. main. java. srcDirs
78- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
79- failOnError true
80- }
81- afterEvaluate {
82- javadoc. classpath + =
83- files(android. libraryVariants. collect { variant -> variant. javaCompile. classpath. files
84- })
85- }
86- } else {
87- // Java libraries
88- task sourcesJar(type : Jar , dependsOn : classes) {
89- classifier = ' sources'
90- from sourceSets. main. allSource
65+ if (project. getPlugins(). hasPlugin(' com.android.application' ) || project. getPlugins().
66+ hasPlugin(' com.android.library' )) {
67+
68+ task androidJavadocs(type : Javadoc ) {
69+ source = android. sourceSets. main. java. source
70+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
71+ }
72+
73+ task androidJavadocsJar(type : Jar , dependsOn : androidJavadocs) {
74+ classifier = ' javadoc'
75+ from androidJavadocs. destinationDir
76+ }
77+
78+ task androidSourcesJar(type : Jar ) {
79+ classifier = ' sources'
80+ from android. sourceSets. main. java. source
81+ }
82+ } else {
83+ task sourcesJar(type : Jar , dependsOn : classes) {
84+ classifier = ' sources'
85+ from sourceSets. main. allSource
86+ }
87+
88+ task javadocJar(type : Jar , dependsOn : Javadoc ) {
89+ classifier = ' javadoc'
90+ from Javadoc . destinationDir
91+ }
9192 }
92- }
9393
94- task javadocJar (type : Jar , dependsOn : javadoc) {
95- classifier = ' javadoc'
96- from javadoc. destinationDir
97- }
94+ if (JavaVersion . current(). isJava8Compatible()) {
95+ allprojects {
96+ tasks. withType(Javadoc ) {
97+ options. addStringOption(' Xdoclint:none' , ' -quiet' )
98+ }
99+ }
100+ }
98101
99- artifacts {
100- archives javadocJar
101- archives sourcesJar
102+ artifacts {
103+ if (project. getPlugins(). hasPlugin(' com.android.application' ) || project. getPlugins().
104+ hasPlugin(' com.android.library' )) {
105+ archives androidSourcesJar
106+ archives androidJavadocsJar
107+ } else {
108+ archives sourcesJar
109+ archives javadocJar
110+ }
111+ }
102112}
0 commit comments