Update gradle build configuration

This commit is contained in:
Dimitry Ivanov 2018-08-18 13:31:06 +03:00
parent bd27f99f8e
commit 0ec683ad48
14 changed files with 125 additions and 87 deletions

View File

@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
applicationId "ru.noties.markwon" applicationId "ru.noties.markwon"
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
setProperty("archivesBaseName", "markwon-sample-$versionName") setProperty("archivesBaseName", "markwon-sample-$versionName")
@ -32,14 +32,16 @@ dependencies {
implementation project(':library-image-loader') implementation project(':library-image-loader')
implementation project(':library-syntax') implementation project(':library-syntax')
implementation 'ru.noties:debug:3.0.0@jar' deps.with {
implementation 'me.saket:better-link-movement-method:2.2.0' implementation it['okhttp']
implementation it['prism4j']
implementation OK_HTTP implementation it['debug']
implementation it['better-link-movement']
implementation 'com.google.dagger:dagger:2.10' implementation it['dagger']
annotationProcessor 'com.google.dagger:dagger-compiler:2.10' }
implementation PRISM_4J deps['annotationProcessor'].with {
annotationProcessor PRISM_4J_BUNDLER annotationProcessor it['prism4j-bundler']
annotationProcessor it['dagger-compiler']
}
} }

View File

@ -44,23 +44,40 @@ ext {
TARGET_SDK = 27 TARGET_SDK = 27
MIN_SDK = 16 MIN_SDK = 16
// Dependencies config = [
'build-tools' : '27.0.3',
'compile-sdk' : 27,
'target-sdk' : 27,
'min-sdk' : 16,
'push-aar-gradle': 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle'
]
final def supportVersion = '27.1.1' final def supportVersion = '27.1.1'
SUPPORT_ANNOTATIONS = "com.android.support:support-annotations:$supportVersion"
SUPPORT_APP_COMPAT = "com.android.support:appcompat-v7:$supportVersion"
final def commonMarkVersion = '0.11.0' final def commonMarkVersion = '0.11.0'
COMMON_MARK = "com.atlassian.commonmark:commonmark:$commonMarkVersion" final def daggerVersion = '2.10'
COMMON_MARK_STRIKETHROUGHT = "com.atlassian.commonmark:commonmark-ext-gfm-strikethrough:$commonMarkVersion"
COMMON_MARK_TABLE = "com.atlassian.commonmark:commonmark-ext-gfm-tables:$commonMarkVersion"
ANDROID_SVG = 'com.caverock:androidsvg:1.2.1' deps = [
ANDROID_GIF = 'pl.droidsonroids.gif:android-gif-drawable:1.2.14' 'support-annotations' : "com.android.support:support-annotations:$supportVersion",
OK_HTTP = 'com.squareup.okhttp3:okhttp:3.9.0' 'support-app-compat' : "com.android.support:appcompat-v7:$supportVersion",
'commonmark' : "com.atlassian.commonmark:commonmark:$commonMarkVersion",
'commonmark-strikethrough': "com.atlassian.commonmark:commonmark-ext-gfm-strikethrough:$commonMarkVersion",
'commonmark-table' : "com.atlassian.commonmark:commonmark-ext-gfm-tables:$commonMarkVersion",
'android-svg' : 'com.caverock:androidsvg:1.2.1',
'android-gif' : 'pl.droidsonroids.gif:android-gif-drawable:1.2.14',
'okhttp' : 'com.squareup.okhttp3:okhttp:3.9.0',
'prism4j' : 'ru.noties:prism4j:1.1.0',
'debug' : 'ru.noties:debug:3.0.0@jar',
'better-link-movement' : 'me.saket:better-link-movement-method:2.2.0',
'dagger' : "com.google.dagger:dagger:$daggerVersion"
]
PRISM_4J = 'ru.noties:prism4j:1.1.0' deps['annotationProcessor'] = [
PRISM_4J_BUNDLER = 'ru.noties:prism4j-bundler:1.1.0' 'prism4j-bundler': 'ru.noties:prism4j-bundler:1.1.0',
'dagger-compiler': "com.google.dagger:dagger-compiler:$daggerVersion"
]
JUNIT = 'junit:junit:4.12' deps['test'] = [
ROBOLECTRIC = 'org.robolectric:robolectric:3.8' 'junit' : 'junit:junit:4.12',
'robolectric': 'org.robolectric:robolectric:3.8'
]
} }

View File

@ -2,19 +2,22 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
} }
dependencies { dependencies {
api SUPPORT_ANNOTATIONS
deps.with {
api it['support-annotations']
}
} }
afterEvaluate { afterEvaluate {
@ -22,11 +25,6 @@ afterEvaluate {
generateReleaseBuildConfig.enabled = false generateReleaseBuildConfig.enabled = false
} }
// todo: remove `local` check after merge with latest version (1.1.1)
if (hasProperty('release')) { if (hasProperty('release')) {
if (hasProperty('local')) { apply from: config['push-aar-gradle']
ext.RELEASE_REPOSITORY_URL = LOCAL_MAVEN_URL
ext.SNAPSHOT_REPOSITORY_URL = LOCAL_MAVEN_URL
}
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle'
} }

View File

@ -0,0 +1,3 @@
POM_NAME=Markwon
POM_ARTIFACT_ID=markwon-html-parser-api
POM_PACKAGING=aar

View File

@ -37,7 +37,7 @@ public interface HtmlTag {
Map<String, String> attributes(); Map<String, String> attributes();
/** /**
* Represents <em>really</em> inline HTML tags (unline commonmark definitions) * Represents <em>really</em> inline HTML tags (unlile commonmark definitions)
*/ */
interface Inline extends HtmlTag { interface Inline extends HtmlTag {
} }

View File

@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
@ -15,11 +15,16 @@ android {
dependencies { dependencies {
api SUPPORT_ANNOTATIONS
api project(':html-parser-api') api project(':html-parser-api')
testImplementation JUNIT deps.with {
testImplementation ROBOLECTRIC api it['support-annotations']
}
deps.test.with {
testImplementation it['junit']
testImplementation it['robolectric']
}
} }
afterEvaluate { afterEvaluate {
@ -27,11 +32,6 @@ afterEvaluate {
generateReleaseBuildConfig.enabled = false generateReleaseBuildConfig.enabled = false
} }
// todo: remove `local` check after merge with latest version (1.1.1)
if (hasProperty('release')) { if (hasProperty('release')) {
if (hasProperty('local')) { apply from: config['push-aar-gradle']
ext.RELEASE_REPOSITORY_URL = LOCAL_MAVEN_URL
ext.SNAPSHOT_REPOSITORY_URL = LOCAL_MAVEN_URL
}
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle'
} }

View File

@ -0,0 +1,3 @@
POM_NAME=Markwon
POM_ARTIFACT_ID=markwon-html-parser-impl
POM_PACKAGING=aar

View File

@ -23,7 +23,7 @@ public class HtmlEmptyTagReplacement {
/** /**
* @return replacement for supplied startTag or null if no replacement should occur (which will * @return replacement for supplied startTag or null if no replacement should occur (which will
* lead to `Inline` tag have start & end the same value, thus not applicable for applying a Span) * lead to `Inline` tag have start &amp; end the same value, thus not applicable for applying a Span)
*/ */
@Nullable @Nullable
public String replace(@NonNull Token.StartTag startTag) { public String replace(@NonNull Token.StartTag startTag) {

View File

@ -1,4 +1,4 @@
package ru.noties.markwon.html; package ru.noties.markwon.html.impl;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;

View File

@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
@ -19,10 +19,14 @@ android {
} }
dependencies { dependencies {
api project(':library') api project(':library')
api ANDROID_SVG
api ANDROID_GIF deps.with {
api OK_HTTP api it['android-svg']
api it['android-gif']
api it['okhttp']
}
} }
afterEvaluate { afterEvaluate {
@ -30,5 +34,5 @@ afterEvaluate {
} }
if (hasProperty('release')) { if (hasProperty('release')) {
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' apply from: config['push-aar-gradle']
} }

View File

@ -2,21 +2,25 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
} }
dependencies { dependencies {
api SUPPORT_ANNOTATIONS
api PRISM_4J
api project(':library') api project(':library')
deps.with {
api it['support-annotations']
api it['prism4j']
}
} }
afterEvaluate { afterEvaluate {
@ -24,5 +28,5 @@ afterEvaluate {
} }
if (hasProperty('release')) { if (hasProperty('release')) {
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' apply from: config['push-aar-gradle']
} }

View File

@ -2,20 +2,24 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
} }
dependencies { dependencies {
api project(':library') api project(':library')
compileOnly SUPPORT_APP_COMPAT
deps.with {
compileOnly it['support-app-compat']
}
} }
afterEvaluate { afterEvaluate {
@ -23,5 +27,5 @@ afterEvaluate {
} }
if (hasProperty('release')) { if (hasProperty('release')) {
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' apply from: config['push-aar-gradle']
} }

View File

@ -2,22 +2,25 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK minSdkVersion config['min-sdk']
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }
} }
dependencies { dependencies {
api SUPPORT_ANNOTATIONS
api COMMON_MARK deps.with {
api COMMON_MARK_STRIKETHROUGHT api it['support-annotations']
api COMMON_MARK_TABLE api it['commonmark']
api it['commonmark-strikethrough']
api it['commonmark-table']
}
} }
afterEvaluate { afterEvaluate {
@ -25,5 +28,5 @@ afterEvaluate {
} }
if (hasProperty('release')) { if (hasProperty('release')) {
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' apply from: config['push-aar-gradle']
} }

View File

@ -2,8 +2,8 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion TARGET_SDK compileSdkVersion config['compile-sdk']
buildToolsVersion BUILD_TOOLS buildToolsVersion config['build-tools']
defaultConfig { defaultConfig {
@ -11,7 +11,7 @@ android {
// using 21 as minimum only to be able to vector assets // using 21 as minimum only to be able to vector assets
minSdkVersion 21 minSdkVersion 21
targetSdkVersion TARGET_SDK targetSdkVersion config['target-sdk']
versionCode 1 versionCode 1
versionName version versionName version
} }