Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting licenses on Android. #184

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
69 changes: 39 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
// First, apply the publishing plugin
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
jcenter()
repositories {
gradlePluginPortal()
google()
jcenter()
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.2'
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+'
}
}

plugins {
id 'com.gradle.build-scan' version '1.16'
id 'groovy'
id 'idea'
id "org.ajoberstar.release-opinion" version "1.4.2"
id 'com.gradle.plugin-publish' version '0.10.0'
id 'java-gradle-plugin'
id 'ru.vyarus.animalsniffer' version '1.4.2'
id 'com.gradle.build-scan' version '2.0.2'
id 'groovy'
id 'idea'
id "org.ajoberstar.release-opinion" version "1.4.2"
id 'com.gradle.plugin-publish' version '0.10.0'
id 'java-gradle-plugin'
id 'ru.vyarus.animalsniffer' version '1.5.1'
}

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}

apply plugin: 'com.github.hierynomus.license'
Expand All @@ -36,7 +35,12 @@ group = 'com.hierynomus.gradle.plugins'
sourceCompatibility = 1.7
targetCompatibility = 1.7

repositories { jcenter() }

repositories {
gradlePluginPortal()
google()
jcenter()
}

idea {
module {
Expand All @@ -46,24 +50,24 @@ idea {
}

release {
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
}

configurations.compile.transitive = false

dependencies {
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
signature 'org.codehaus.mojo.signature:java17:1.0@signature'

compile "org.codehaus.plexus:plexus-utils:2.0.5"
compile "com.mycila.xmltool:xmltool:3.3"
// Using compile instead of groovy, so that it goes into the pom
compile ('com.mycila:license-maven-plugin:3.0') {
compile('com.mycila:license-maven-plugin:3.0') {
exclude group: 'org.apache.maven', module: 'maven-plugin-api'
exclude group: 'org.apache.maven', module: 'maven-project'
}
compile gradleApi()

def androidGradlePlugin = 'com.android.tools.build:gradle:2.0.+'
def androidGradlePlugin = 'com.android.tools.build:gradle:3.6.3'
compileOnly androidGradlePlugin
testCompile androidGradlePlugin

Expand Down Expand Up @@ -97,14 +101,19 @@ license {
ignoreFailures true
}

animalsniffer {
excludeJars 'gradle-api-*'
ignoreFailures true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what it doesn't work. I've created an issue for Animals Sniffer
xvik/gradle-animalsniffer-plugin#22

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that after animal sniffer update, this should not be needed anymore.

}

test {
afterSuite { descriptor, result ->
def indicator = "\u001B[32m✓\u001b[0m"
if (result.failedTestCount > 0) {
indicator = "\u001B[31m✘\u001b[0m"
afterSuite { descriptor, result ->
def indicator = "\u001B[32m✓\u001b[0m"
if (result.failedTestCount > 0) {
indicator = "\u001B[31m✘\u001b[0m"
}
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
}
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
}
}

def pomConfig = {
Expand Down Expand Up @@ -181,7 +190,7 @@ pluginBundle {
licenseReportPlugin {
displayName = "License Report plugin for Gradle"
description = "Reports over licenses"
tags = [ "gradle", "plugin", "license", "report" ]
tags = ["gradle", "plugin", "license", "report"]
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apply plugin: 'groovy'

repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://dl.google.com/dl/android/maven2/" }
jcenter()
}

Expand All @@ -9,13 +11,13 @@ configurations.compile.transitive = false
dependencies {
compile "org.codehaus.plexus:plexus-utils:2.0.5"
compile "com.mycila.xmltool:xmltool:3.3"
compile ('com.mycila:license-maven-plugin:3.0') {
compile('com.mycila:license-maven-plugin:3.0') {
exclude group: 'org.apache.maven', module: 'maven-plugin-api'
exclude group: 'org.apache.maven', module: 'maven-project'
}
compile gradleApi()

compileOnly 'com.android.tools.build:gradle:2.0.+'
compileOnly 'com.android.tools.build:gradle:3.6.3'
}

sourceSets {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 08 16:48:23 EST 2014
#Mon Apr 20 15:51:30 BST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Loading