Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Unify setup, improve a few things and bump versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed May 27, 2018
1 parent d34c116 commit 711c572
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 76 deletions.
46 changes: 25 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
language: groovy
language: android

groovy:
- 2.3.6
- 2.3.9

jdk:
- oraclejdk8
jdk: oraclejdk8

before_install:
- pip install --user codecov

install: true
# Download SDK
- yes | sdkmanager "tools" &>/dev/null
- yes | sdkmanager "platform-tools" &>/dev/null
- yes | sdkmanager "build-tools;27.0.3" &>/dev/null
- yes | sdkmanager "platforms;android-27" &>/dev/null
# Update remaining dependencies and accept licenses
- yes | sdkmanager --update &>/dev/null
- yes | sdkmanager --licenses &>/dev/null

script: ./gradlew clean build

after_success:
- codecov
- .buildscript/deploy_snapshot.sh
- bash <(curl -s https://codecov.io/bash)
- .buildscript/deploy_snapshot.sh

env:
global:
- secure: "MzOFFRAE6bEO5NzGQBFQ1am0lHwbsWqRdP/OTL/Ka/QgjryIETiLZdNUua23DwcJMuiMKVR0I03lqW5PCF0yT1+R8KECncF1P61YrHtATr0KhfXJ/z3DcqtxsBJ4gtVEJfuBXCgdHyYbMmS6UJVMgejCqv4YKYQggtOe/wgNm0PjwPOEQ7aktz47yEUbQOr9jxNwYDLNGzbgc9oBt+rFFYY+EfcbLQrrfq6sMyioc9c8UqNESRcAgapptwnywofd1fbgSvZ1kYpwD9scPcFgZFiG7KzNyxU0/GL2ojAT3buZFYKEToAFLTKFdHJTzwMMlUOMFoW4FB/aMlObvCcaguuMhkoD8ApaJg9Y3YLTkUzBDc6AvIvg4MwoujP6NawJJZEinG1EtuKc577WtXIpaA700s+m/go/Bsel27TUIFWnPQiPUyuyUoHvd/1xI2d1EWKZjudeaHTIhv5N8Y1W3Lb2AriSZ2ijK22I4QnrikDv1iWTaPYr8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k58lIVC/sVrWd3uxWFph6rUUEM0wgC9Uz2y2iye8OauamgfN5RP7e2ETR0NnI9USik/KuKD1MhVMh8A3q2GyaMMTEFg20dhJP40hRntb0sUxv0DW/sqIWp9I="

branches:
except:
- gh-pages
except:
- gh-pages

notifications:
email: false
email: false

sudo: false

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle
- $HOME/.m2
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
35 changes: 18 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,39 @@ buildscript {
}

dependencies {
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.9'
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.10'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.11.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.1.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.2.0'
}
}

apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'com.vanniktech.android.junit.jacoco'
apply plugin: "com.vanniktech.maven.publish"

gradlePlugin {
plugins {
androidJavadocPlugin {
id = 'com.vanniktech.android.javadoc'
implementationClass = 'com.vanniktech.android.javadoc.Generation'
}
}
}

repositories {
jcenter()
mavenCentral()
google()
jcenter()
}

dependencies {
compile gradleApi()
compile localGroovy()
api gradleApi()
api localGroovy()

compileOnly 'com.android.tools.build:gradle:3.1.2'

Expand All @@ -52,16 +63,6 @@ pluginBundle {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.5'
gradleVersion = '4.7'
distributionType = Wrapper.DistributionType.ALL
}

test {
environment "ANDROID_HOME", System.getenv("ANDROID_HOME")
testLogging {
showStackTraces true
showStandardStreams = true
events "failed"
exceptionFormat "full"
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ import org.gradle.api.Task
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.testfixtures.ProjectBuilder
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException

import java.nio.file.Path
import java.nio.file.Paths

class GenerationTest {
@Rule public ExpectedException expectedException = ExpectedException.none()

Expand All @@ -24,7 +20,10 @@ class GenerationTest {
void setUp() {
generation = new Generation()
project = ProjectBuilder.builder().withName('project').build()
copyManifest()

def manifestFile = new File(project.projectDir, "src/main/AndroidManifest.xml")
manifestFile.getParentFile().mkdirs()
manifestFile.setText('<manifest package="com.foo.bar"/>')
}

@Test
Expand Down Expand Up @@ -73,7 +72,6 @@ class GenerationTest {

@Test
void testAndroidAppProject() {
doNotRunOnTravis()
withAndroidAppProject()

// These tasks are only added after project.afterEvaluated() is called.
Expand All @@ -94,7 +92,6 @@ class GenerationTest {

@Test
void testAndroidAppProjectInverseApply() {
doNotRunOnTravis()

// Apply javadoc plugin first
generation.apply(project)
Expand All @@ -118,7 +115,6 @@ class GenerationTest {

@Test
void testAndroidLibraryProject() {
doNotRunOnTravis()
withAndroidLibProject()

// These tasks are only added after project.afterEvaluated() is called.
Expand All @@ -139,7 +135,6 @@ class GenerationTest {

@Test
void filterVariant() {
doNotRunOnTravis()
withAndroidAppProject()

project.androidJavadoc.variantFilter { variant ->
Expand All @@ -158,7 +153,6 @@ class GenerationTest {

@Test
void transformTaskName() {
doNotRunOnTravis()
withAndroidAppProject()

project.androidJavadoc.taskNameTransformer { variant ->
Expand Down Expand Up @@ -196,23 +190,6 @@ class GenerationTest {
targetSdkVersion 27
versionCode 1
versionName "dev"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}

private void copyManifest() {
Path source = Paths.get("./src/test/res/AndroidManifest.xml").toAbsolutePath().normalize()
Path dest = Paths.get(project.projectDir.getPath(), "src/main")
dest.toFile().mkdirs()
dest = Paths.get(dest.toString(), "AndroidManifest.xml")
dest.toFile() << source.toFile().text
}

private static void doNotRunOnTravis() { // Unless we know how to have a good ANDROID_HOME env var on travis.
String res = System.getenv("TRAVIS")
if (res != null) {
Assume.assumeFalse(res == "true")
}
}
}
9 changes: 0 additions & 9 deletions src/test/res/AndroidManifest.xml

This file was deleted.

0 comments on commit 711c572

Please sign in to comment.