Skip to content

Commit e3d9d9c

Browse files
committed
split and join instead of replace
1 parent 9afb2c0 commit e3d9d9c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ allprojects {
4545
def fn = project.rootProject.file("local.properties")
4646
if (!fn.exists()) {
4747
if (System.env["ANDROID_SDK"] != null) {
48-
def path = System.env["ANDROID_SDK"].replace(Pattern.quote(File.separator), "/")
48+
def syspath = System.env["ANDROID_SDK"]
49+
def parts = syspath.split(Pattern.quote(File.separator))
50+
def path = String.join("/", parts)
4951
fn.withWriterAppend { w ->
5052
w << "sdk.dir=${path}\n"
5153
}
@@ -55,10 +57,7 @@ allprojects {
5557
"Define ANDROID_SDK so it points to the location of the Android SDK, or create the local.properties file manually\n" +
5658
"and add the following line to it:\n" +
5759
"sdk.dir=<path to Android SDK>")
58-
}
59-
60-
61-
// new File( folder, 'file.txt' )
60+
}
6261
}
6362

6463

0 commit comments

Comments
 (0)