-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ plugins { | |
} | ||
|
||
group 'com.formkiq.gradle' | ||
version '1.4.0' | ||
version '1.5.0' | ||
|
||
java { | ||
toolchain { | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.formkiq.gradle.internal; | ||
|
||
import java.io.File; | ||
import org.gradle.internal.os.OperatingSystem; | ||
|
||
/** | ||
* | ||
* {@link String} utilities. | ||
* | ||
*/ | ||
public class Strings { | ||
|
||
/** | ||
* Format {@link File} in Unix format. | ||
* | ||
* @param file {@link File} | ||
* @return {@link String} | ||
*/ | ||
public static String formatToUnix(final File file) { | ||
String path = file.getAbsolutePath(); | ||
|
||
return formatToUnix(path); | ||
} | ||
|
||
/** | ||
* Format {@link String} in Unix format. | ||
* | ||
* @param path {@link String} | ||
* @return {@link String} | ||
*/ | ||
public static String formatToUnix(final String path) { | ||
String s = path; | ||
if (OperatingSystem.current().isWindows()) { | ||
s = s.replace("\\", "/").replace(":", ""); | ||
if (!s.startsWith("/")) { | ||
s = "/" + s; | ||
} | ||
} | ||
|
||
return s; | ||
} | ||
} |