Created
August 25, 2017 22:04
-
-
Save mark-vieira/ad6ba9c6512cdd91acbdffce88e0653e to your computer and use it in GitHub Desktop.
Build cache plugin hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.internal.project.ProjectInternal | |
import org.gradle.caching.configuration.internal.BuildCacheConfigurationInternal | |
import org.gradle.caching.http.HttpBuildCache | |
class BuildCachePlugin implements Plugin<Project> { | |
@Override | |
void apply(Project project) { | |
def cacheConfig = ((ProjectInternal) project).services.get(BuildCacheConfigurationInternal) | |
cacheConfig.remote(HttpBuildCache) { HttpBuildCache cache -> | |
cache.enabled = true | |
cache.push = true | |
cache.url = 'http://localhost/cache/' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment