Skip to content

Commit

Permalink
Generate solution task up-to-date fix (#138)
Browse files Browse the repository at this point in the history
## Description
GenerateSolution task was being up-to-date even though it has no inputs and it wasn't meant to be. This happens because of inherited inputs from its parent class.

Ps: this PR is forked from #137 

## Changes
* ![FIX] GenerateSolution now is never up-to-date
  • Loading branch information
Joaquimmnetto authored Jan 18, 2022
1 parent 384823e commit 18f8818
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ class GenerateSolutionTaskIntegrationSpec extends UnityTaskIntegrationSpec<Gener
res.standardOutput.contains("-executeMethod UnityEditor.SyncVS.SyncSolution")
}


@UnityPluginTestOptions(addMockTask = false, disableAutoActivateAndLicense = false)
def "generateSolution task is never up-to-date"() {
given: "applied atlas-unity plugin"

when: "generateSolution task is called"
def firstRes = runTasksSuccessfully("generateSolution")
and: "generateSolution task is called again"
def secondRes = runTasksSuccessfully("generateSolution")

then: "neither of ran tasks were up-to-date"
!firstRes.wasUpToDate(":generateSolution")
!secondRes.wasUpToDate(":generateSolution")
}

@Requires({ os.macOs })
@UnityPluginTestOptions(unityPath = UnityPathResolution.Default)
@UnityInstallation(version = "2019.4.24f1", cleanup = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,4 @@ class TestTaskIntegrationSpec extends UnityTaskIntegrationSpec<Test> {
taskResult.args.contains("-debugCodeOptimization")

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import wooga.gradle.unity.UnityTask
class GenerateSolution extends UnityTask {

GenerateSolution() {
outputs.upToDateWhen { false }
executeMethod = "UnityEditor.SyncVS.SyncSolution"
}
}

0 comments on commit 18f8818

Please sign in to comment.