-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Gradle scripts to Kotlin (#15)
- Loading branch information
1 parent
23080eb
commit 6387ab1
Showing
4 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
import java.io.BufferedReader | ||
import java.io.InputStreamReader | ||
|
||
plugins { | ||
`java-library` | ||
} | ||
|
||
val junitVersion = "4.13.2" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = "uk.co.mainwave.mimetypes" | ||
version = getVersionFromGit() | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
dependencies { | ||
testImplementation("junit:junit:$junitVersion") | ||
} | ||
|
||
fun getVersionFromGit(): String { | ||
val processBuilder = ProcessBuilder(listOf("git", "describe", "--tags", "--always")) | ||
try { | ||
val process = processBuilder.start() | ||
val reader = BufferedReader(InputStreamReader(process.inputStream)) | ||
val output = StringBuilder() | ||
output.append(reader.readLine()) | ||
process.waitFor() | ||
return output.toString() | ||
} catch (e: Exception) { | ||
return "1.0.0" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
rootProject.name = "mimetypes" | ||
|