Skip to content

Commit

Permalink
Add lifecycle publish task, update tests for it
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Shestakov committed Jun 18, 2018
1 parent 5c9cd5e commit 5f0b51d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,17 @@ class UnityBuildPluginIntegrationSpec extends UnityIntegrationSpec {
"check" | "platform" | "environment" | 'iOS' | 'IOSCi'
"check" | "platform" | "properties" | 'iOS' | 'IOSCi'
"check" | "platform" | "extension" | 'iOS' | 'IOSCi'
"publish" | "platform" | "environment" | 'iOS' | 'IOSCi'
"publish" | "platform" | "properties" | 'iOS' | 'IOSCi'
"publish" | "platform" | "extension" | 'iOS' | 'IOSCi'
"assemble" | "environment" | "environment" | 'staging' | 'AndroidStaging'
"assemble" | "environment" | "properties" | 'staging' | 'AndroidStaging'
"assemble" | "environment" | "extension" | 'staging' | 'AndroidStaging'
"check" | "environment" | "environment" | 'staging' | 'AndroidStaging'
"check" | "environment" | "properties" | 'staging' | 'AndroidStaging'
"check" | "environment" | "extension" | 'staging' | 'AndroidStaging'
"publish" | "environment" | "extension" | 'staging' | 'AndroidStaging'
"publish" | "environment" | "extension" | 'staging' | 'AndroidStaging'
"publish" | "environment" | "extension" | 'staging' | 'AndroidStaging'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.BasePlugin
import org.gradle.api.publish.plugins.PublishingPlugin
import org.gradle.language.base.plugins.LifecycleBasePlugin
import wooga.gradle.unity.UnityPlugin
import wooga.gradle.build.unity.internal.DefaultUnityBuildPluginExtension
Expand All @@ -40,7 +41,10 @@ class UnityBuildPlugin implements Plugin<Project> {
def extension = project.extensions.create(UnityBuildPluginExtension, EXTENSION_NAME, DefaultUnityBuildPluginExtension, project)
def exportLifecycleTask = project.tasks.create(EXPORT_ALL_TASK_NAME)

def baseLifecycleTaskNames = [LifecycleBasePlugin.ASSEMBLE_TASK_NAME, LifecycleBasePlugin.CHECK_TASK_NAME, LifecycleBasePlugin.BUILD_TASK_NAME]
def baseLifecycleTaskNames = [LifecycleBasePlugin.ASSEMBLE_TASK_NAME,
LifecycleBasePlugin.CHECK_TASK_NAME,
LifecycleBasePlugin.BUILD_TASK_NAME,
PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME]

project.tasks.withType(UnityBuildPlayerTask, new Action<UnityBuildPlayerTask>() {
@Override
Expand All @@ -53,6 +57,8 @@ class UnityBuildPlugin implements Plugin<Project> {
}
})

project.tasks.maybeCreate(PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME)

project.afterEvaluate {
extension.platforms.each { String platform ->
def platformLifecycleTask = project.tasks.create("export${platform.capitalize()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ class UnityBuildPluginSpec extends ProjectSpec {
"exportIOS" | DefaultTask
"exportAndroid" | DefaultTask
"exportWebGL" | DefaultTask
"publish" | DefaultTask
"publishAndroidCi" | DefaultTask
"assemble" | DefaultTask
"assembleAndroidCi" | DefaultTask
"build" | DefaultTask
"buildAndroidCi" | DefaultTask
"check" | DefaultTask
"checkAndroidCi" | DefaultTask
}

@Unroll
Expand Down

0 comments on commit 5f0b51d

Please sign in to comment.