...
 
Commits (74)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
......@@ -21,8 +21,14 @@ apply plugin: 'eclipse'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
// 1.5.3 has a classloader leak (https://github.com/asciidoctor/asciidoctor-gradle-plugin/pull/215)
// 1.5.6 requires Java 8+ (https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/218)
def asciidoctorPluginVersion = JavaVersion.current() == JavaVersion.VERSION_1_7 ? '1.5.3' : '1.5.6'
repositories {
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
maven { url "https://repo.gradle.org/gradle/libs-snapshots" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
......@@ -36,20 +42,24 @@ dependencies {
exclude(module: 'xercesImpl')
}
testCompile 'junit:junit:4.12@jar'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4@jar', 'cglib:cglib-nodep:2.2', 'org.objenesis:objenesis:1.2'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4@jar', 'cglib:cglib-nodep:3.2.5', 'org.objenesis:objenesis:1.2'
testCompile 'org.hamcrest:hamcrest-core:1.3'
compile "org.pegdown:pegdown:1.6.0"
compile "org.jsoup:jsoup:1.6.3"
compile 'me.champeau.gradle:japicmp-gradle-plugin:0.2.4'
compile "org.asciidoctor:asciidoctor-gradle-plugin:$asciidoctorPluginVersion"
compile 'com.github.javaparser:javaparser-core:2.4.0'
}
ext.isCiServer = System.getenv().containsKey("CI")
apply from: '../gradle/compile.gradle'
apply from: '../gradle/taskOrdering.gradle'
apply from: '../gradle/dependencies.gradle'
apply from: '../gradle/classycle.gradle'
ext.isCiServer = System.getenv().containsKey("TEAMCITY_VERSION")
if (!isCiServer || (isCiServer && Boolean.getBoolean('enableCodeQuality'))) {
apply from: '../gradle/codeQuality.gradle'
}
apply from: "../gradle/ciReporting.gradle"
......@@ -14,7 +14,4 @@
* limitations under the License.
*/
if (gradle.startParameter.systemPropertiesArgs.containsKey("gradle.cache.remote.url")) {
println "Applying remoteHttpCacheInit to buildSrc"
apply from: new File(settingsDir, '../gradle/remoteHttpCacheInit.gradle')
}
apply from: new File(settingsDir, '../gradle/remoteHttpCacheSettings.gradle')
This diff is collapsed.
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.binarycompatibility
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.gradle.util.GradleVersion
class AcceptedApiChanges {
GradleVersion baseVersion
Map<ApiChange, String> acceptedChanges
static AcceptedApiChanges parse(String jsonText) {
def json = new JsonSlurper().parseText(jsonText)
def acceptedApiChanges = new AcceptedApiChanges()
acceptedApiChanges.acceptedChanges = json.acceptedApiChanges.collectEntries { jsonChange ->
[(ApiChange.parse(jsonChange)): jsonChange.acceptation]
}
return acceptedApiChanges
}
Map<String, String> toAcceptedChangesMap() {
acceptedChanges.collectEntries { change ->
[(JsonOutput.toJson(change.key)): change.value]
}
}
static Map<ApiChange, String> fromAcceptedChangesMap(Map<String, String> acceptedChanges) {
acceptedChanges.collectEntries { key, value ->
[(ApiChange.parse(new JsonSlurper().parseText(key))): value]
}
}
}
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.binarycompatibility
import groovy.transform.Immutable
@Immutable
class ApiChange {
String type
String member
List<String> changes
static ApiChange parse(Object json) {
new ApiChange(json.type, json.member, json.changes ?: [])
}
String toString() {
def formattedMember = member - "$type."
"$type - $formattedMember - $changes"
}
}
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.binarycompatibility.rules
import com.github.javaparser.JavaParser
import com.github.javaparser.ast.body.MethodDeclaration
import com.github.javaparser.ast.visitor.GenericVisitorAdapter
import groovy.json.JsonOutput
import groovy.transform.CompileStatic
import japicmp.model.JApiClass
import japicmp.model.JApiCompatibility
import japicmp.model.JApiConstructor
import japicmp.model.JApiField
import japicmp.model.JApiHasAnnotations
import japicmp.model.JApiMethod
import me.champeau.gradle.japicmp.report.AbstractContextAwareViolationRule
import me.champeau.gradle.japicmp.report.Violation
import org.gradle.api.Incubating
import org.gradle.binarycompatibility.AcceptedApiChanges
import org.gradle.binarycompatibility.ApiChange
import javax.inject.Inject
@CompileStatic
abstract class AbstractGradleViolationRule extends AbstractContextAwareViolationRule {
private final Map<ApiChange, String> acceptedApiChanges
AbstractGradleViolationRule(Map<String, String> acceptedApiChanges) {
this.acceptedApiChanges = AcceptedApiChanges.fromAcceptedChangesMap(acceptedApiChanges)
}
private static boolean isAnnotatedWithIncubating(JApiHasAnnotations member) {
member.annotations*.fullyQualifiedName.any { it == Incubating.name }
}
private static boolean isAnnotatedWithDeprecated(JApiHasAnnotations member) {
member.annotations*.fullyQualifiedName.any { it == Deprecated.name }
}
private static boolean isAnnotatedWithInject(JApiHasAnnotations member) {
member.annotations*.fullyQualifiedName.any { it == Inject.name }
}
boolean isInject(JApiHasAnnotations member) {
return isAnnotatedWithInject(member)
}
boolean isIncubatingOrDeprecated(JApiHasAnnotations member) {
if (member instanceof JApiClass) {
return isIncubatingOrDeprecated((JApiClass) member)
} else if (member instanceof JApiMethod) {
return isIncubatingOrDeprecatedOrOverride((JApiMethod) member)
} else if (member instanceof JApiField) {
return isIncubatingOrDeprecated((JApiField) member)
} else if (member instanceof JApiConstructor) {