Skip to content

Commit

Permalink
update dependencies ("org.vafer:jdeb:1.1" -> "org.vafer:jdeb:1.4")
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Aug 9, 2015
1 parent 014664b commit 686b413
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 95 deletions.
69 changes: 17 additions & 52 deletions build.gradle
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'versions'
apply plugin: 'com.github.ben-manes.versions'

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand All @@ -13,39 +13,20 @@ archivesBaseName = 'gradle-debian-plugin'

buildscript {
repositories {
maven {
url 'http://jcenter.bintray.com'
}
maven {
url 'http://kt3k.github.io/repository/maven/release'
}
maven {
url "https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo"
}
jcenter()
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-5'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3'
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.6'

classpath 'net.saliman:gradle-cobertura-plugin:1.1.2'
// classpath 'net.saliman:gradle-cobertura-plugin:2.2.4'

classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.1.5'
// classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3.1'
classpath 'net.saliman:gradle-cobertura-plugin:2.2.8'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
}
}
apply plugin: 'bintray'
//apply plugin: 'com.jfrog.bintray'

apply plugin: 'cobertura'
//apply plugin: 'net.saliman.cobertura'

apply plugin: 'coveralls'
//apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'net.saliman.cobertura'
apply plugin: 'com.github.kt3k.coveralls'

cobertura {
coverageFormats = ['html', 'xml']
Expand All @@ -61,25 +42,11 @@ configurations.all {
failOnVersionConflict()

def dependencyVersions = [
'org.codehaus.plexus:plexus-classworlds' : '1.2-alpha-9',
'org.codehaus.plexus:plexus-container-default': '1.0-alpha-30',
'org.codehaus.plexus:plexus-interactivity-api': '1.0-alpha-6',
'org.codehaus.plexus:plexus-utils' : '1.5.15',
'classworlds:classworlds' : '1.1',
'commons-httpclient:commons-httpclient' : '3.1',
'commons-io:commons-io' : '2.4',
'commons-codec:commons-codec' : '1.6',
'org.hamcrest:hamcrest-core' : '1.3',
'org.slf4j:slf4j-nop' : '1.7.2',
'org.slf4j:slf4j-jdk14' : '1.7.2',
'org.slf4j:slf4j-api' : '1.7.2',
'org.slf4j:jcl-over-slf4j' : '1.7.2',
'org.apache.ant:ant' : '1.9.2',
'org.apache.ant:ant-launcher' : '1.9.2',
'junit:junit' : '4.11',
'xerces:xmlParserAPIs' : '2.6.2',
'xerces:xercesImpl' : '2.6.2',
'xml-apis:xml-apis' : '2.0.2'
'org.codehaus.plexus:plexus-classworlds': '2.5.2',
'org.codehaus.plexus:plexus-utils' : '3.0.20',
'org.apache.maven:maven-core' : '3.0.4',
'org.apache.maven:maven-plugin-api' : '3.0.4',
'junit:junit' : '4.11'
]

force dependencyVersions.collect { k, v -> "$k:$v" }
Expand All @@ -89,13 +56,11 @@ configurations.all {
dependencies {
compile gradleApi()
compile localGroovy()
// groovy 'org.codehaus.groovy:groovy-all:2.0.5'

compile 'org.vafer:jdeb:1.1'
compile 'org.vafer:jdeb:1.4'
compile 'commons-lang:commons-lang:2.6'

testCompile 'org.spockframework:spock-core:0.7-groovy-1.8'
// testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.3'
testCompile 'cglib:cglib-nodep:2.2.2'
}

Expand Down Expand Up @@ -142,6 +107,6 @@ bintray {
bintrayUpload.dependsOn(":build")

task wrapper(type: Wrapper) {
gradleVersion = '1.12'
gradleVersion = '2.5'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Nov 06 21:37:48 CET 2014
#Sun Aug 09 12:58:51 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.5-all.zip
Expand Up @@ -3,11 +3,12 @@ package de.gesellix.gradle.debian
import de.gesellix.gradle.debian.tasks.BuildDebianPackageTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.publish.maven.MavenPublication

import static de.gesellix.gradle.debian.DebianPackagePluginExtension.DEBPKGPLUGIN_EXTENSION_NAME
import static de.gesellix.gradle.debian.tasks.BuildDebianPackageTask.DEBPKGTASK_NAME
import static org.apache.commons.lang.StringUtils.capitalize
import static org.gradle.api.publish.maven.plugins.MavenPublishPlugin.PUBLISH_LOCAL_LIFECYCLE_TASK_NAME
import static org.gradle.language.base.plugins.LifecycleBasePlugin.BUILD_TASK_NAME

class DebianPackagePlugin implements Plugin<Project> {

Expand Down Expand Up @@ -40,11 +41,21 @@ class DebianPackagePlugin implements Plugin<Project> {
if (extension.publications?.length) {
def publicationsByProject = publicationFinder.findPublicationsInProject(project, extension.publications as String[])
publicationsByProject.each { MavenPublicationsByProject mavenPublicationByProject ->
mavenPublicationByProject.publications.each { publication ->
mavenPublicationByProject.publications.each { MavenPublication publication ->
/*
def taskName = "generatePomFileFor${capitalize(publication.name)}Publication"
Task publicationTask = mavenPublicationByProject.project.tasks.findByName(taskName)
task.dependsOn(publicationTask)
task.dependsOn(mavenPublicationByProject.project.tasks.findByName('build'))
if (publicationTask) {
task.dependsOn(publicationTask)
} else {
// def publishTask = mavenPublicationByProject.project.tasks.findByName('publish')
// task.dependsOn(publishTask)
// task.dependsOn({ mavenPublicationByProject.project.tasks.findByName(taskName) })
task.dependsOn(publication.getArtifacts())
}
*/
task.dependsOn(mavenPublicationByProject.project.tasks.findByName(PUBLISH_LOCAL_LIFECYCLE_TASK_NAME))
task.dependsOn(mavenPublicationByProject.project.tasks.findByName(BUILD_TASK_NAME))
}
}
}
Expand Down
Expand Up @@ -48,12 +48,7 @@ class DataProducerChangelog extends AbstractDataProducer implements DataProducer

final InputStream inputStream = new ByteArrayInputStream(compressedAsBytes)
try {
receiver.onEachFile(inputStream,
entry.getName(), entry.getLinkName(),
entry.getUserName(), entry.getUserId(),
entry.getGroupName(), entry.getGroupId(),
entry.getMode(),
entry.getSize())
receiver.onEachFile(inputStream, entry)
}
catch (Throwable t) {
println t
Expand Down
Expand Up @@ -10,6 +10,8 @@ import spock.lang.Specification

import static de.gesellix.gradle.debian.DebianPackagePluginExtension.DEBPKGPLUGIN_EXTENSION_NAME
import static de.gesellix.gradle.debian.tasks.BuildDebianPackageTask.DEBPKGTASK_NAME
import static org.gradle.api.publish.maven.plugins.MavenPublishPlugin.PUBLISH_LOCAL_LIFECYCLE_TASK_NAME
import static org.gradle.language.base.plugins.LifecycleBasePlugin.BUILD_TASK_NAME

class DebianPackagePluginSpec extends Specification {

Expand Down Expand Up @@ -86,7 +88,7 @@ class DebianPackagePluginSpec extends Specification {
project.evaluate()
then:
Task buildDebTask = project.tasks.findByName(DEBPKGTASK_NAME)
Task publicationTask = project.tasks.findByName("generatePomFileForMavenStuffPublication")
Task publicationTask = project.tasks.findByName(PUBLISH_LOCAL_LIFECYCLE_TASK_NAME)
buildDebTask.taskDependencies.getDependencies(buildDebTask).contains(publicationTask)
}

Expand All @@ -96,6 +98,6 @@ class DebianPackagePluginSpec extends Specification {
project.evaluate()
then:
Task buildDebTask = project.tasks.findByName(DEBPKGTASK_NAME)
buildDebTask.taskDependencies.getDependencies(buildDebTask).contains(project.tasks.findByName("build"))
buildDebTask.taskDependencies.getDependencies(buildDebTask).contains(project.tasks.findByName(BUILD_TASK_NAME))
}
}
Expand Up @@ -67,26 +67,27 @@ class BuildDebianPackageTaskTest {
"debian-binary" : "2.0\n",
"control.tar.gz": [
"./conffiles": new TarEntryFileMatcher("./src/test/resources/expected/conffiles"),
"./prerm" : new TarEntryFileMatcher("./src/test/resources/expected/prerm"),
"./postinst": new TarEntryFileMatcher("./src/test/resources/expected/postinst"),
"./postrm" : new TarEntryFileMatcher("./src/test/resources/expected/postrm"),
"./control" : new TarEntryFileMatcher("./src/test/resources/expected/control"),
"./md5sums" : new TarEntryFileMatcher("./src/test/resources/expected/md5sums")],
"./prerm" : new TarEntryFileMatcher("./src/test/resources/expected/prerm"),
"./postinst" : new TarEntryFileMatcher("./src/test/resources/expected/postinst"),
"./postrm" : new TarEntryFileMatcher("./src/test/resources/expected/postrm"),
"./control" : new TarEntryFileMatcher("./src/test/resources/expected/control"),
"./md5sums" : new TarEntryFileMatcher("./src/test/resources/expected/md5sums")],
"data.tar.gz" : [
"./opt/" : null,
"./opt/includedFile.txt" : new TarEntryFileMatcher("./src/test/resources/inputfiles/subdirectory/includedFile.txt"),
"./opt/subsub/" : null,
"./opt/subsub/anotherIncludedFile.txt": new TarEntryFileMatcher("./src/test/resources/inputfiles/subdirectory/subsub/anotherIncludedFile.txt"),
"./usr/" : null,
"./usr/share/" : null,
"./usr/share/doc/" : null,
"./usr/share/doc/packagename/" : null,
"./opt/" : null,
"./opt/includedFile.txt" : new TarEntryFileMatcher("./src/test/resources/inputfiles/subdirectory/includedFile.txt"),
"./opt/subsub/" : null,
"./opt/subsub/anotherIncludedFile.txt" : new TarEntryFileMatcher("./src/test/resources/inputfiles/subdirectory/subsub/anotherIncludedFile.txt"),
"./usr/" : null,
"./usr/share/" : null,
"./usr/share/doc/" : null,
"./usr/share/doc/packagename/" : null,
"./usr/share/doc/packagename/changelog.gz": new TarEntryGzipMatcher("./src/test/resources/expected/changelog.gz"),
"./usr/test/" : null,
"./usr/test/input.txt" : new TarEntryFileMatcher("./src/test/resources/inputfiles/input.txt"),
"./usr/test/2/" : null,
"./usr/test/2/binary.jpg" : new TarEntryFileMatcher("./src/test/resources/inputfiles/binary.jpg")
]])
"./usr/test/" : null,
"./usr/test/input.txt" : new TarEntryFileMatcher("./src/test/resources/inputfiles/input.txt"),
"./usr/test/2/" : null,
"./usr/test/2/binary.jpg" : new TarEntryFileMatcher("./src/test/resources/inputfiles/binary.jpg")
]
])
}

static def assertDebianArchiveContents(File file, Map<String, Object> reference) {
Expand All @@ -98,16 +99,19 @@ class BuildDebianPackageTaskTest {

if (!arEntry.name.endsWith(".tar.gz")) {
assert toByteArray(arArchive) == reference[arEntry.name].bytes
}
else {
} else {
def tarArchive = new TarArchiveInputStream(new GzipCompressorInputStream(arArchive))
def tarEntry
while ((tarEntry = tarArchive.nextEntry) != null) {
assert tarEntry.name in reference[arEntry.name].keySet()
if (!tarEntry.directory) {
def entryMatcher = reference[arEntry.name][tarEntry.name] as TarEntryFileMatcher
def actualBytes = toByteArray(tarArchive)
assert entryMatcher.apply(actualBytes)
def matches = entryMatcher.apply(actualBytes)
if (!matches) {
println "${arEntry.name} -- ${tarEntry.name}"
}
assert matches
}
}
}
Expand Down
Expand Up @@ -20,7 +20,13 @@ class DataProducerChangelogSpec extends Specification {
when:
dataProducerChangelog.produce(dataConsumer)
then:
1 * dataConsumer.onEachFile(_ as InputStream, "destinationFile", "", "root", 0, "root", 0, DEFAULT_FILE_MODE, 20)
1 * dataConsumer.onEachFile(_ as InputStream, {
it.name == "destinationFile" &&
it.userName == "root" &&
it.groupName == "root" &&
it.mode == DEFAULT_FILE_MODE &&
it.size == 20
})
0 * dataConsumer.onEachDir(_, _, _, _, _, _, _, _)
0 * dataConsumer.onEachLink(_, _, _, _, _, _, _, _)
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/resources/expected/md5sums
@@ -1,5 +1,5 @@
33a2e453f94b41900c3039cb1777e805 ./opt/includedFile.txt
1d43c13fdddc6fffdff4f9f5eddb15a2 ./opt/subsub/anotherIncludedFile.txt
e28a2ebd7838725dbfdd3094325af0f2 ./usr/test/input.txt
dacc5a3298d68f79757d5eb14031a04a ./usr/test/2/binary.jpg
3024fb8c20638047fc55d0f71b8eaa9f ./usr/share/doc/packagename/changelog.gz
33a2e453f94b41900c3039cb1777e805 ./opt/includedFile.txt
1d43c13fdddc6fffdff4f9f5eddb15a2 ./opt/subsub/anotherIncludedFile.txt
e28a2ebd7838725dbfdd3094325af0f2 ./usr/test/input.txt
dacc5a3298d68f79757d5eb14031a04a ./usr/test/2/binary.jpg
3024fb8c20638047fc55d0f71b8eaa9f ./usr/share/doc/packagename/changelog.gz
2 changes: 1 addition & 1 deletion src/test/resources/gradle/build.gradle
Expand Up @@ -13,7 +13,7 @@ repositories {
publishing {
publications {
mavenStuff(MavenPublication) {
artifact new File("${projectDir}/../inputfiles/artifact.war")
artifact file("${projectDir}/../inputfiles/artifact.war")
}
}
}
Expand Down

0 comments on commit 686b413

Please sign in to comment.