Skip to content

Commit

Permalink
Feature dependency definition in build.gradle
Browse files Browse the repository at this point in the history
Description
===========

This is the first part if bringing the basic paket configuration
(paket.dependencies, paket.template, paket.references) into the gradle
project. This change adds custom `paket` dependency handler to the
gradle dependency handler and a nuget repository factory.

*build.gradle*
```groovy
dependencies {
    paket {
        nuget "Test ~> 1"
    }
}

repositories {
   nuget {
       url 'some/url'
   }
}
```

At the moment only `nuget` dependencies are supported.
When dependencies are configured in the `build.gradle` file, a
`paket.dependencies` file will be generated. If this file already
exists, it will be overridden.

Changes
=======

![ADD] paket dependencies handler
![ADD] nuget dependency definition
![ADD] nuget dependency source artifact repository handler
![ADD] new task `paketDependencies`
  • Loading branch information
Larusso committed May 25, 2018
1 parent ba02eb8 commit 310e6f5
Show file tree
Hide file tree
Showing 37 changed files with 1,823 additions and 20 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ dependencies {
testCompile('org.jfrog.artifactory.client:artifactory-java-client-services:2.+') {
exclude module: 'logback-classic'
}

compile('com.google.guava:guava:19.0')
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
package wooga.gradle.paket

import org.apache.commons.io.FileUtils
import org.apache.commons.lang.StringEscapeUtils
import spock.lang.Shared

class IntegrationSpec extends nebula.test.IntegrationSpec{

@Shared
File cachedPaketDir

def escapedPath(String path) {
String osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("windows")) {
return StringEscapeUtils.escapeJava(path)
}
path
}

def setupSpec() {
cachedPaketDir = File.createTempDir("paket","cache")
cachedPaketDir.deleteOnExit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package wooga.gradle.paket
import nebula.test.functional.ExecutionResult
import spock.lang.Shared
import spock.lang.Unroll
import wooga.gradle.paket.base.PaketBasePlugin

abstract class PaketIntegrationBaseSpec extends IntegrationSpec {

Expand Down Expand Up @@ -58,6 +59,18 @@ abstract class PaketIntegrationBaseSpec extends IntegrationSpec {
taskToRun << bootstrapTestCases
}

@Unroll
def "task :paketBootstrap calls :paketDependencies when runing #taskToRun"(String taskToRun) {
when:
def result = runTasksSuccessfully(taskToRun)

then:
result.wasExecuted(PaketBasePlugin.PAKET_DEPENDENCIES_TASK_NAME)

where:
taskToRun << bootstrapTestCases
}

@Unroll
def "skip bootstrap when files are [UP-TO-DATE] when running #taskToRun"(String taskToRun) {
given: "a paket dependency file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,5 @@ abstract class PaketIntegrationDependencyFileSpec extends PaketIntegrationBaseSp
then: "evaluate incremental task execution"
result.wasExecuted("paketInstall")
result.wasExecuted(PaketUnityPlugin.INSTALL_TASK_NAME)


}
}

0 comments on commit 310e6f5

Please sign in to comment.