Last active
May 23, 2019 11:26
-
-
Save amartinj/62ddf45860cf077f2306f2ba1beb404c to your computer and use it in GitHub Desktop.
Basic gradle file (kotlin)
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
group = "net.sek.lib" | |
version = "1.0-SNAPSHOT" | |
plugins { | |
`maven-publish` | |
kotlin("jvm") version "1.3.31" | |
} | |
repositories { | |
jcenter() | |
mavenCentral() | |
} | |
dependencies { | |
implementation(kotlin("stdlib")) | |
} | |
publishing { | |
val mavenUser: String by project | |
val mavenPassword: String by project | |
val baseRepo: String by project | |
publications { | |
create<MavenPublication>("default") { | |
from(components["java"]) | |
} | |
} | |
repositories { | |
maven { | |
credentials { | |
username = mavenUser | |
password = mavenPassword | |
} | |
url = when { | |
(version as String).endsWith("SNAPSHOT") -> uri("$baseRepo/maven-snapshots") | |
else -> uri("$baseRepo/maven-releases") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment