Atlas Unity

a Unity 3D gradle plugin


Project maintained by wooga

atlas-unity

Gradle Plugin ID Build Status Coveralls Status Apache 2.0 GitHub tag GitHub release

This plugin provides tasks to run unity batchmode commands in gradle. It runs and reports unity unit-tests and is able to export .unitypackage files.

Applying the plugin

build.gradle

plugins {
    id 'net.wooga.unity' version '1.5.0'
}

Note breaking changes with 0.16.0

With 0.16.0 the dependency setup for iOS and android will be removed from the plugin. The logic never really fitted into this plugin. It is moved to net.wooga.wdk-unity.

System Requirements

Unity3D > 5.5

Usage

build.gradle

plugins {
    id "net.wooga.unity" version "0.16.0"
}

unity {
    authentication {
        username = "username@company.com"
        password = "password"
        serial = "unityserial"
    }

    // projectPath = ""
    // reportsDir = ""
    // unityPath = ""

    //autoActivateUnity = true
    //autoReturnLicense = true

    //assetsDir = "Assets"
    //pluginsDir = "Assets/Plugins"

    //defaultBuildTarget = "android"
}

exportUnityPackage {
    inputFiles file('Assets')
}

task(performBuild, type:wooga.gradle.unity.tasks.Unity) {
    args "-executeMethod", "MyEditorScript.PerformBuild"

    // projectPath
    // buildTarget
    // logFile
    // quit = true || quit true
    // batchMode = true batchMode true
    // noGraphics = false noGraphics false
}

task(performMultipleBuilds) {
    doLast {
        unity.batchMode {
            unityPath = project.file("/Applications/Unity-5.5.3f1/Unity.app/Contents/MacOS/Unity")
            args "-executeMethod", "MyEditorScript.PerformBuild"
        }

        unity.batchMode {
            unityPath = project.file("/Applications/Unity-5.6.0f3/Unity.app/Contents/MacOS/Unity")
            args "-executeMethod", "MyEditorScript.PerformBuild"
        }
    }
}

//hook up the tasks into the lifecycle
tasks.assemble.dependsOn performBuild
tasks.assemble.dependsOn performMultipleBuilds
tasks.returnUnityLicense.mustRunAfter performMultipleBuilds

Documentation

Gradle and Java Compatibility

Built with Oracle JDK7 Tested with Oracle JDK8

Gradle Version Works
<= 2.14 no
3.0 yes
3.1 yes
3.2 yes
3.3 yes
3.4 yes
3.4.1 yes
3.5 yes
3.5.1 yes
4.0 yes
4.1 yes
4.2 yes
4.3 yes
4.4 yes
4.5 yes
4.6 yes
4.7 yes
4.8 yes
4.9 yes
4.10 yes

Development

Code of Conduct

LICENSE

Copyright 2017 Wooga GmbH

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.