forked from clojurephant/clojurephant
-
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.
Merge pull request clojurephant#152 from clojurephant/fixes
Additional fixes to finalize 0.6.0
- Loading branch information
Showing
34 changed files
with
421 additions
and
451 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
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,13 @@ | ||
plugins { | ||
id("org.ajoberstar.grgit") | ||
id("org.ajoberstar.reckon") | ||
id("com.diffplug.spotless") | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// Versioning and Release | ||
/////////////////////////////////////////////////////////////////////////////// | ||
reckon { | ||
scopeFromProp() | ||
stageFromProp("alpha", "beta", "rc", "final") | ||
} |
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,13 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
maven(url = "https://repo.clojars.org") | ||
} | ||
|
||
dependencies { | ||
implementation("dev.clojurephant:clojurephant-plugin:0.6.0-alpha.4") | ||
implementation("com.diffplug.spotless:spotless-plugin-gradle:5.9.0") | ||
} |
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,72 @@ | ||
import java.io.ByteArrayOutputStream | ||
import org.apache.tools.ant.filters.ReplaceTokens | ||
import org.gradle.util.GradleVersion | ||
|
||
plugins { | ||
id("dev.clojurephant.clojure") | ||
id("maven-publish") | ||
} | ||
|
||
dependencies { | ||
compileOnly("org.clojure:clojure:1.10.1") | ||
compileOnly("seancorfield:clj-new:1.1.234") | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("main") { | ||
group = project.name | ||
artifactId = "clj-template" | ||
from(components["java"]) | ||
} | ||
} | ||
} | ||
|
||
tasks.named<Copy>("processResources") { | ||
eachFile { | ||
if (name.endsWith(".gradle")) { | ||
filter(ReplaceTokens::class, "tokens" to mapOf("clojurephant.version" to project.version.toString())) | ||
} | ||
} | ||
} | ||
|
||
tasks.register<JavaExec>("newProject") { | ||
workingDir = file("${rootProject.projectDir}/templates-test") | ||
classpath = files(sourceSets["main"].output, configurations["compileClasspath"]) | ||
main = "clojure.main" | ||
args("-m", "clj-new.create", project.name, "my.group/sample-${project.name}", "+localplugin") | ||
doFirst { | ||
workingDir.mkdirs() | ||
delete("${workingDir}/sample-${project.name}") | ||
} | ||
dependsOn(tasks.jar) | ||
dependsOn(":clojurephant-tools:publishToMavenLocal") | ||
dependsOn(":clojurephant-plugin:publishToMavenLocal") | ||
} | ||
|
||
tasks.register<Exec>("verifyGradleVersion") { | ||
dependsOn(tasks.named("newProject")) | ||
|
||
workingDir = file("${rootProject.projectDir}/templates-test/sample-${project.name}") | ||
if (System.getProperty("os.name").toLowerCase().contains("windows")) { | ||
executable = "gradlew.bat" | ||
} else { | ||
executable = "./gradlew" | ||
} | ||
args("--version") | ||
|
||
standardOutput = ByteArrayOutputStream() | ||
doLast { | ||
val out = standardOutput.toString() | ||
val versionPattern = """Gradle (\d+\S+)""".toRegex() | ||
val matchResult = versionPattern.find(out) | ||
val (version) = matchResult!!.destructured | ||
if (!GradleVersion.version(version).equals(GradleVersion.current())) { | ||
throw GradleException("Templates have incorrect Gradle wrapper \"$version\". Run ./copy-wrapper.ps1 to update.") | ||
} | ||
} | ||
} | ||
|
||
tasks.named("check") { | ||
dependsOn(tasks.named("verifyGradleVersion")) | ||
} |
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,96 @@ | ||
plugins { | ||
java | ||
`maven-publish` | ||
id("dev.clojurephant.clojure") | ||
id("com.diffplug.spotless") | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// Dependencies | ||
/////////////////////////////////////////////////////////////////////////////// | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "Clojars" | ||
url = uri("https://repo.clojars.org/") | ||
} | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// Packaging | ||
/////////////////////////////////////////////////////////////////////////////// | ||
group = "dev.clojurephant" | ||
|
||
configure<JavaPluginConvention> { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
tasks.register<Jar>("sourcesJar") { | ||
from(sourceSets["main"].allSource) | ||
archiveClassifier.set("sources") | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// Code Style and Formatting | ||
/////////////////////////////////////////////////////////////////////////////// | ||
spotless { | ||
java { | ||
importOrder("java", "javax", "") | ||
removeUnusedImports() | ||
eclipse().configFile(rootProject.file("gradle/eclipse-java-formatter.xml")) | ||
} | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// Publishing | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
// Publish to following repositories | ||
publishing { | ||
repositories { | ||
maven { | ||
name = "bintray" | ||
url = uri("https://api.bintray.com/maven/clojurephant/maven/clojurephant/;publish=1") | ||
credentials { | ||
username = System.getenv("BINTRAY_USER") | ||
password = System.getenv("BINTRAY_KEY") | ||
} | ||
} | ||
maven { | ||
name = "clojars" | ||
url = uri("https://repo.clojars.org") | ||
credentials { | ||
username = System.getenv("CLOJARS_USER") | ||
password = System.getenv("CLOJARS_TOKEN") | ||
} | ||
} | ||
} | ||
publications.withType<MavenPublication>() { | ||
// use static versions in poms | ||
versionMapping { | ||
usage("java-api") { | ||
fromResolutionOf("runtimeClasspath") | ||
} | ||
usage("java-runtime") { | ||
fromResolutionResult() | ||
} | ||
} | ||
|
||
pom { | ||
// include repository info in POM (needed for cljdoc) | ||
scm { | ||
connection.set("https://github.com/clojurephant/clojurephant.git") | ||
developerConnection.set("git@github.com:clojurephant/clojurephant.git") | ||
url.set("https://github.com/clojurephant/clojurephant") | ||
if (!version.toString().contains("+")) { | ||
tag.set(version.toString()) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Clojars doesn"t support module metadata | ||
tasks.withType<GenerateModuleMetadata>() { | ||
enabled = false | ||
} |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# DO NOT MODIFY: Generated by Stutter plugin. | ||
6.3 | ||
6.7.1 | ||
6.8-rc-5 | ||
6.8 |
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 |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
5.0 | ||
5.6.4 | ||
6.0.1 | ||
6.7.1 | ||
6.8-rc-5 | ||
6.8 |
Oops, something went wrong.