buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.3.2' classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0' } } allprojects { repositories { if (project.hasProperty('LOCAL_MAVEN_URL')) { maven { url LOCAL_MAVEN_URL } } google() jcenter() } version = VERSION_NAME group = GROUP tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') } } task clean(type: Delete) { delete rootProject.buildDir } task wrapper(type: Wrapper) { gradleVersion '4.10.2' distributionType 'all' } if (hasProperty('local')) { if (!hasProperty('LOCAL_MAVEN_URL')) { throw new RuntimeException('Cannot publish to local maven as no such property exists: LOCAL_MAVEN_URL') } ext.RELEASE_REPOSITORY_URL = LOCAL_MAVEN_URL ext.SNAPSHOT_REPOSITORY_URL = LOCAL_MAVEN_URL } ext { // NB, updating build-tools or compile-sdk will require updating Travis config (.travis.yml) config = [ 'build-tools' : '28.0.3', 'compile-sdk' : 28, 'target-sdk' : 28, 'min-sdk' : 16, 'push-aar-gradle': 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' ] final def supportVersion = '28.0.0' final def commonMarkVersion = '0.12.1' final def daggerVersion = '2.10' deps = [ 'support-annotations' : "com.android.support:support-annotations:$supportVersion", 'support-app-compat' : "com.android.support:appcompat-v7:$supportVersion", 'support-recycler-view' : "com.android.support:recyclerview-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', 'jlatexmath-android' : 'ru.noties:jlatexmath-android:0.1.0', 'okhttp' : 'com.squareup.okhttp3:okhttp:3.9.0', 'prism4j' : 'ru.noties:prism4j:1.1.0', 'debug' : 'ru.noties:debug:3.0.0@jar', 'adapt' : 'ru.noties:adapt:1.1.0', 'dagger' : "com.google.dagger:dagger:$daggerVersion" ] deps['annotationProcessor'] = [ 'prism4j-bundler': 'ru.noties:prism4j-bundler:1.1.0', 'dagger-compiler': "com.google.dagger:dagger-compiler:$daggerVersion" ] deps['test'] = [ 'junit' : 'junit:junit:4.12', 'robolectric': 'org.robolectric:robolectric:3.8', 'ix-java' : 'com.github.akarnokd:ixjava:1.0.0', 'commons-io' : 'commons-io:commons-io:2.6', 'mockito' : 'org.mockito:mockito-core:2.21.0' ] registerArtifact = this.®isterArtifact } task checkUpdates { apply plugin: 'com.github.ben-manes.versions' dependsOn 'dependencyUpdates' } def registerArtifact(project) { if (hasProperty('release')) { project.apply from: config['push-aar-gradle'] } project.afterEvaluate { // disable generation of BuildConfig files project.generateDebugBuildConfig.enabled = false project.generateReleaseBuildConfig.enabled = false // print test status (for CI) project.android.testOptions.unitTests.all { testLogging { events "passed", "skipped", "failed" exceptionFormat "short" showStandardStreams = true } } } }