This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix to the resolution strategy (#68)
* fix to the resolution strategy * chang manifest file to be optional
- Loading branch information
Robin-Hentschel-Wooga
authored
Feb 14, 2023
1 parent
0c0567b
commit 2129afb
Showing
3 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/groovy/wooga/gradle/wdk/unity/tasks/ResolveUnityPackages.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package wooga.gradle.wdk.unity.tasks | ||
|
||
import org.gradle.api.file.FileCollection | ||
import org.gradle.api.file.RegularFile | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.provider.Provider | ||
import org.gradle.api.tasks.InputFiles | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.OutputFile | ||
import org.gradle.api.tasks.SkipWhenEmpty | ||
import org.gradle.api.tasks.TaskAction | ||
import wooga.gradle.unity.UnityTask | ||
|
||
class ResolveUnityPackages extends UnityTask { | ||
|
||
@InputFiles | ||
@SkipWhenEmpty | ||
FileCollection getInputFiles() { | ||
project.files(manifest) | ||
} | ||
|
||
private final RegularFileProperty manifest = objects.fileProperty() | ||
|
||
@Internal | ||
RegularFileProperty getManifest() { | ||
manifest | ||
} | ||
|
||
void setManifest(Provider<RegularFile> value) { | ||
manifest.set(value) | ||
} | ||
|
||
void setManifest(File value) { | ||
manifest.set(value) | ||
} | ||
private final RegularFileProperty packageLock = objects.fileProperty() | ||
|
||
@OutputFile | ||
RegularFileProperty getPackageLock() { | ||
packageLock | ||
} | ||
|
||
void setPackageLock(Provider<RegularFile> value) { | ||
packageLock.set(value) | ||
} | ||
|
||
void setPackageLock(File value) { | ||
packageLock.set(value) | ||
} | ||
|
||
@TaskAction | ||
protected resolve() { | ||
packageLock.get().asFile.delete() | ||
exec() | ||
} | ||
} |