diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-06-19 13:56:51 -0500 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-07-12 20:21:14 +0200 |
commit | 93dc9770902dc7e168869d88b5ad731bfc0bedd9 (patch) | |
tree | 97ba885661d5cd9a2115fe212df31bacec9f9947 /sonar-plugin-api-impl/build.gradle | |
parent | 7c7d9b6b90244d2c974207862071caccdb2c9bb5 (diff) | |
download | sonarqube-93dc9770902dc7e168869d88b5ad731bfc0bedd9.tar.gz sonarqube-93dc9770902dc7e168869d88b5ad731bfc0bedd9.zip |
Extract implementation from plugin API and create new module sonar-plugin-api-impl
Diffstat (limited to 'sonar-plugin-api-impl/build.gradle')
-rw-r--r-- | sonar-plugin-api-impl/build.gradle | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/sonar-plugin-api-impl/build.gradle b/sonar-plugin-api-impl/build.gradle new file mode 100644 index 00000000000..6046e6eef9a --- /dev/null +++ b/sonar-plugin-api-impl/build.gradle @@ -0,0 +1,87 @@ +sonarqube { + properties { + property 'sonar.projectName', "${projectTitle} :: Plugin API Implementation" + } +} + +apply plugin: 'com.github.johnrengelman.shadow' + +dependencies { + // please keep the list grouped by configuration and ordered by name + + compile 'commons-codec:commons-codec' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compile 'com.google.code.gson:gson' + compile 'org.apache.commons:commons-csv' + + // shaded, but not relocated + compile project(':sonar-check-api') + compile project(':sonar-plugin-api') + compile project(':sonar-ws') + + + shadow 'org.codehaus.staxmate:staxmate' + shadow 'org.codehaus.woodstox:stax2-api' + shadow 'org.codehaus.woodstox:woodstox-core-lgpl' + + compileOnly 'ch.qos.logback:logback-classic' + compileOnly 'ch.qos.logback:logback-core' + compileOnly 'com.google.code.findbugs:jsr305' + compileOnly 'javax.servlet:javax.servlet-api' + compileOnly 'junit:junit' + compileOnly 'org.slf4j:slf4j-api' + + testCompile 'com.google.guava:guava' + testCompile 'com.tngtech.java:junit-dataprovider' + testCompile 'org.assertj:assertj-core' + testCompile 'org.mockito:mockito-core' + testCompile project(':sonar-scanner-engine') + testCompile project(':server:sonar-server') + +} + +sourceSets { + // Make the compileOnly dependencies available when compiling/running tests + test.compileClasspath += configurations.compileOnly + configurations.shadow + test.runtimeClasspath += configurations.compileOnly + configurations.shadow +} + +def on3Digits(version) { + def projectversion3digits = version - ~/-\w+/ + projectversion3digits = projectversion3digits.tokenize('.').plus(0).take(3).join('.') +} + +import org.apache.tools.ant.filters.ReplaceTokens +processResources { + filter ReplaceTokens, tokens: [ + // The build version is composed of 4 fields, including the semantic version and the build number provided by Travis. + 'project.buildVersion': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version) + '.' + System.getProperty("buildNumber"), + 'project.version.3digits': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version) + ] +} + +shadowJar { + configurations = [project.configurations.default] + relocate('com.google', 'org.sonar.api.internal.google') + relocate('org.apache.commons', 'org.sonar.api.internal.apachecommons') + dependencies { + exclude(dependency('org.codehaus.woodstox:woodstox-core-lgpl')) + exclude(dependency('org.codehaus.woodstox:stax2-api')) + exclude(dependency('org.codehaus.staxmate:staxmate')) + } +} + +artifactoryPublish.skip = false + +publishing { + publications { + mavenJava(MavenPublication) { + artifact source: shadowJar, classifier: null + if (release) { + artifact sourcesJar + artifact javadocJar + } + } + } +} |