Gradle plugin to move build process to remote machine.
Switch branches/tags
Clone or download
Pull request Compare This branch is 27 commits ahead, 17 commits behind buildfoundation:3.x.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark
docs
gradle/wrapper
plugin-test
plugin
.gitignore
.travis-ssh.sh
.travis.yml
LICENSE.txt
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Mirakle

A Gradle plugin that allows you to move build process from a local machine to a remote one.

Compatible with Gradle 3.3+. Works seamlessly with IntelliJ IDEA and Android Studio.

Why

Remote machine supposed to be much performant than you working machine. Also having a sufficient network bandwidth or small amount of data that your build produce, you gain build speed boost.

How it differs from Mainframer

Mirakle is designed specially for Gradle build system. It works as seamless as possible. Once plugin installed, you workflow will not be different at all.

(It's a good thing to prank your colleague. Imagine his surprise when one day he get several times faster build time.)

Setup

  • Put this into USER_HOME/.gradle/init.d/mirakle_init.gradle
initscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.instamotor:mirakle:1.2.0"
    }
}
 
apply plugin: Mirakle
 
rootProject {
    mirakle {
        host "your_remote_machine"
    }
}

Usage

> ./gradlew build

Here's Mirakle. All tasks will be executed on a remote machine.
:uploadToRemote
:executeOnRemote
...remote build output...
:downloadFromRemote
 

BUILD SUCCESSFUL
 
Total time : 7.975 secs
Task uploadToRemote took: 2.237 secs
Task executeOnRemote took: 3.706 secs
Task downloadFromRemote took: 1.597 secs

To disable remote execution pass -x mirakle

> ./gradlew build install -x mirakle

Configuration

mirakle {
    host "true-remote"
    
    //optional
    remoteFolder ".mirakle"
    excludeLocal += ["foo"]
    excludeRemote += ["bar"]
    excludeCommon += ["**/foobar"]
    rsyncToRemoteArgs += ["--stats", "-h"]
    rsyncFromRemoteArgs += ["--compress-level=5", "--stats", "-h"]
    sshArgs += ["-p 22"]
    fallback true
}

Per-project config

You can configure Mirakle differently for any project. There's two ways:

  1. In USER_HOME/.gradle/init.d/mirakle_init.gradle
initscript { .. }
 
apply plugin: Mirakle
 
rootProject {
    if (name == "My Home Project") {
        mirakle {
            host "my-build-server"
            sshArgs += ["-p 222"]
        }
    } else {
        mirakle {
            host "office-build-server"
        }
    }
}
  1. In PROJECT_DIR/mirakle.gradle. This is useful if you want too add the config to VCS.
mirakle {
    host "my-build-server"
    sshArgs += ["-p 222"]
}

Note: mirakle.gradle is the only Gradle build file in the project dir which is evaluated on local machine. Other build files are ignored for the sake of saving time.

Mainframer config is also supported.

Contributing

License

Copyright 2017 Instamotor, Inc.

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.