Skip to content

Commit

Permalink
0.6.39 Fix looping editing gradle.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Dec 23, 2020
1 parent 13252ff commit 61f8903
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
Binary file removed build/artifactory/repack-fixed.jar
Binary file not shown.
Binary file removed build/libs/gradle-plugin-0.6.38-javadoc.jar
Binary file not shown.
Binary file removed build/libs/gradle-plugin-0.6.38-sources.jar
Binary file not shown.
Binary file removed build/libs/gradle-plugin-0.6.38.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.daemon.idletimeout=600000
description=Automatic Gradle plugin. Caching, Cleaning, Maven Offline
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding\=UTF-8 -XX\:MaxHeapSize\=256m -Xmx536M -Dkotlin.daemon.jvm.options\="-Xmx536M" -XX\:MaxPermSize\=128M -XX\:MaxMetaspaceSize\=512m
version=0.6.38
version=0.6.39
org.gradle.cache.cleanup=false
kotlin_version=1.4.10
systemProp.file.encoding=utf-8
Expand Down
6 changes: 4 additions & 2 deletions src/main/groovy/com/dimaslanjaka/gradle/core/Plugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.TaskState
import org.json.JSONArray
import org.json.JSONObject

import static com.dimaslanjaka.gradle.utils.ConsoleColors.*
Expand Down Expand Up @@ -83,12 +82,15 @@ class Plugin implements org.gradle.api.Plugin<Project> {
project.repositories.add(project.repositories.jcenter())
project.repositories.add(project.repositories.mavenCentral())
project.repositories.add(project.repositories.mavenLocal())
project.repositories.add(project.repositories.maven {
/*project.repositories.add(project.repositories.maven {
url "https://maven.pkg.github.com/dimaslanjaka/gradle-plugin"
credentials {
username = "dimaslanjaka"
password = "d98acb59134fabab05145ddeb7abe4441db18b4a"
}
})*/
project.repositories.add(project.repositories.maven {
url "https://plugins.gradle.org/m2/"
})
project.repositories.add(project.repositories.maven { url offlineRepositoryRoot })
//project.dependencies.add('compile', 'io.realm:realm-android:0.80.3')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class OfflineDependenciesPlugin {
boolean isAndroidProject = project.plugins.hasPlugin('com.android.application') || project.plugins.hasPlugin('com.android.library')
boolean isKotlinMultiplatformProject = project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")
File propertiesFile = new File("${project.rootDir.absolutePath}/gradle.properties")
if (!propertiesFile.exists()) return
File checkFile = new File("${project.rootDir.absolutePath}/build/gradle-properties.txt")
if (!propertiesFile.exists() || checkFile.exists()) return
Properties gradleprop = new Properties(propertiesFile, true)

if (isAndroidProject) {
Expand All @@ -164,7 +165,7 @@ class OfflineDependenciesPlugin {
gradleprop.hasOrSet("org.gradle.jvmargs", "-Xms512m -Xmx512m -Xss512m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=512m -XX:+UseCompressedOops -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8")
gradleprop.hasOrSet("systemProp.file.encoding", "utf-8")
gradleprop.hasOrSet("org.gradle.parallel", "false")
gradleprop.hasOrSet("org.gradle.configureondemand", "true")
gradleprop.hasOrSet("org.gradle.configureondemand", "false")
gradleprop.hasOrSet("org.gradle.cache.cleanup", "true")
String javaHome = System.getProperty("java.home")
if (!gradleprop.has("org.gradle.java.temp")) {
Expand All @@ -189,6 +190,9 @@ class OfflineDependenciesPlugin {
if (!rootp.exists()) rootp.mkdirs()
gradleprop.set("systemProp.gradle.user.home", "${rootp}")
}

checkFile.createNewFile()
checkFile.text = "gradle.properties already edited"
//gradleprop.hasOrSet("org.gradle.unsafe.configuration-cache", "ON");
// Use this flag sparingly, in case some of the plugins are not fully compatible
//gradleprop.hasOrSet("org.gradle.unsafe.configuration-cache-problems", "warn");
Expand Down

0 comments on commit 61f8903

Please sign in to comment.