• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wooga / atlas-build-unity / 49 / 1
78%
master: 78%

Build:
DEFAULT BRANCH: master
Ran 21 Sep 2018 12:49PM UTC
Files 19
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Sep 2018 12:49PM UTC coverage: 74.627% (-1.5%) from 76.131%
49.1

push

jenkins

Refactor net.wooga.build-unity to use gradle Provider API (#20)

## Description

This patch introduces the gradle [Provider API] to
`net.wooga.build-unity` to enable future proof lazy configuration.

### Breaking Changes

The change to the [Provider API] comes with some breaking changes. I
made the deliberate choice not to add backwards compatible API methods
to see what the base API can offer out of the box. It also makes the
change to this new and cleaner API more clear.

### Noticeable example

The [Provider API] is in it's core very `functional`. The provider
objects are lazy and need to be queried for a value. As in every new API
we need to bind legacy API to the new system. This is what happens here:

**DefaultUnityBuildPluginExtension.groovy**
```groovy
appConfigsDirectory.set(assetsDir.dir(UnityBuildPluginConsts.DEFAULT_APP_CONFIGS_DIRECTORY))

assetsDir.set(project.provider(new Callable<Directory>() {
    @Override
    Directory call() throws Exception {
        UnityPluginExtension unity = project.extensions.getByType(UnityPluginExtension)
        def assetDir = project.layout.directoryProperty()
        assetDir.set(project.file(unity.assetsDir))
        assetDir.get()
    }
}))
```

The `assetsDir` property provided by `net.wooga.unity` plugin is not
implemented as a `Property<Directory>`. So we need to wrap it in a
custom `Provider` to make this value usable in a `Provider` chain.

The API has still some overhead and boilerplate code but makes it way
easier to construct lazy evaluated properties.

### Property API changes

As of this moment, gradle doesn't support auto generation of property
methods. I removed these API calls along with the old setter. It is
possible to bring these back.

```groovy
build-unity {
  toolsVersion "1.1.1"      //no longer working
  toolsVersion = "1.1.1"    //only property access enabled
  toolsVersion.set("1.1.1") //native way to set a `Provider` property
}... (continued)

550 of 737 relevant lines covered (74.63%)

0.75 hits per line

Source Files on job 49.1
  • Tree
  • List 0
  • Changed 19
  • Source Changed 19
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 49
  • f3f6314f on github
  • Prev Job for on master (#48.1)
  • Next Job for on master (#50.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc