Skip to content

wooga/atlas-unity

Repository files navigation

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 '2.4.0'
}

System Requirements

Unity3D > 5.5

Usage

build.gradle

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

unity {
    authentication {
        username = "[email protected]"
        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
< 5.1 no
5.1 yes
5.2 yes
5.3 yes
5.4 yes
5.5 yes
5.6 yes
5.6 yes
6.0 yes
6.1 yes
6.2 yes
6.3 yes
6.4 yes
6.5 yes
6.6 yes
6.6 yes
6.7 yes
6.8 yes
6.9 yes
7.0 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.