Skip to content

Commit

Permalink
remove buildSrc directory
Browse files Browse the repository at this point in the history
  • Loading branch information
akolomentsev committed Apr 6, 2018
1 parent a6b0bab commit 53895b4
Show file tree
Hide file tree
Showing 26 changed files with 154 additions and 106 deletions.
72 changes: 29 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"

classpath "com.satori:satori-libs-gradle-transform:$scaffoldingVersion"
classpath "com.satori:satori-libs-gradle-github:$scaffoldingVersion"
classpath "com.satori:satori-libs-composition-drawer:$scaffoldingVersion"
}
}

import com.satori.libs.gradle.transform.*

gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS
apply plugin: "com.satori.transform"
apply plugin: "com.satori.github"
apply plugin: "com.satori.composition.drawer"

apply plugin: 'idea'

Expand All @@ -32,50 +39,28 @@ idea {
ext {
pckg = group
pckgDir = pckg.replace('.', '/')
examples = container(Object)
}

afterEvaluate {
task generateBigBlueBusImage(type: JavaExec) {
group 'codegen'

def cfgPath = project(":mods-examples-big-blue-bus").file("res/com/satori/mods/resources/config.json")
def imgPath = rootProject.file("docs/files/big-blue-bus-composition.png")

inputs.file(cfgPath)
outputs.file(imgPath)

classpath project(":libs-composition-drawer").sourceSets.main.output
classpath project(":libs-composition-drawer").configurations.runtime

main = "${project(":libs-composition-drawer").pckg}.App"
args "--cfg-path", cfgPath
args "--img-path", imgPath

doFirst {
println "generating composition diagram ...."
println commandLine.join(" ")
}
}

task generateReadme(type: TransformTask) {
group 'codegen'
dependsOn generateBigBlueBusImage
template = file('readme.template.md')
output = file('readme.md')
outputs.upToDateWhen { false }
}

tasks.generateReadme.execute()

task generateCode {
group "codegen"
}
task classes {
dependsOn generateCode
group "build"
}
task build {
dependsOn classes
group "build"
}

void transform(Closure closure) {
def spec = new TransformSpec(project)
closure.delegate = spec
closure.resolveStrategy = Closure.DELEGATE_FIRST
closure()
Transform.execute(spec, project)
task generateReadme(type: TransformTask) {
group 'codegen'
template = file('readme.template.md')
output = file('readme.md')
//outputs.upToDateWhen { false }
}
generateCode.dependsOn generateReadme

allprojects {
task info() {
Expand Down Expand Up @@ -146,7 +131,7 @@ subprojects {
dependencies {
}

sourceSets.all {sourceSet ->
sourceSets.all { sourceSet ->
def n = sourceSet.name
n = n != "main" ? n.capitalize() : ""
def taskName = "generate${n}Code"
Expand Down Expand Up @@ -267,6 +252,7 @@ task githubListReleases(type: GitHubListReleasesTask) {
}

task githubPublishRelease(type: GitHubPublishReleaseTask) {
dependsOn generateCode
url = githubUrl
if (project.hasProperty('githubAuthToken')) {
authToken = githubAuthToken
Expand Down
14 changes: 0 additions & 14 deletions buildSrc/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion buildSrc/gradle.properties

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group=com.satori
version=0.5.17-SNAPSHOT
version=0.5.22-SNAPSHOT

scaffoldingVersion=0.5.16-SNAPSHOT
scaffoldingVersion=0.5.21-SNAPSHOT

#nexusUsername=
#nexusPassword=
Expand Down
1 change: 1 addition & 0 deletions libs/composition-drawer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply from: rootProject.file('readme.gradle')
// main dependencies
dependencies {
compile project(":composer")
compile project(":libs-gradle-utils")

compile "org.slf4j:slf4j-api:$slf4jVersion"

Expand Down
6 changes: 3 additions & 3 deletions libs/composition-drawer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ buildscript{
}
}
dependencies {
classpath "com.satori:satori-libs-composition-drawer:0.5.17-SNAPSHOT"
classpath "com.satori:satori-libs-composition-drawer:0.5.22-SNAPSHOT"
}
}
Expand All @@ -47,7 +47,7 @@ repositories {
configurations{compositionDrawer}
dependencies {
compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.17-SNAPSHOT"
compositionDrawer "com.satori:satori-libs-composition-drawer:0.5.22-SNAPSHOT"
}
task generateCompositionDiagram(type: JavaExec) {
Expand Down Expand Up @@ -85,7 +85,7 @@ task generateCompositionDiagram(type: JavaExec) {
<dependency>
<groupId>com.satori</groupId>
<artifactId>satori-libs-composition-drawer</artifactId>
<version>0.5.17-SNAPSHOT</version>
<version>0.5.22-SNAPSHOT</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation-class=com.satori.libs.composition.drawer.CompositionDrawerPlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.satori.libs.composition.drawer

import com.satori.libs.gradle.utils.*
import org.gradle.api.*

open class CompositionDrawerPlugin : Plugin<Project> {

override fun apply(project: Project) {
project.addExtension("GenerateCompositionDiagramTask", GenerateCompositionDiagramTask::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.satori.libs.composition.drawer

import com.mxgraph.util.*
import com.satori.libs.composition.drawer.*
import org.gradle.api.*
import org.gradle.api.tasks.*
import java.awt.*
Expand All @@ -26,10 +27,9 @@ open class GenerateCompositionDiagramTask : DefaultTask() {
@TaskAction
fun generateImage() {
println(MetaInfo)


val cfgPath = cfgPath ?: throw Exception("cfgPath not specified")

cfgPath.toPath().parent.toFile().mkdirs()
val graph = createGraph(
cfgPath ?: throw Exception("cfgPath not specified"),
Expand Down
2 changes: 2 additions & 0 deletions libs/gradle/github/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

// main dependencies
dependencies {
compile project(":libs-gradle-utils")

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation-class=com.satori.libs.gradle.github.GitHubPlugin
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.satori.libs.gradle.github

import org.gradle.api.tasks.*

open class GitHubDeleteReleaseTask : GitHubTask() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.satori.libs.gradle.github

import org.gradle.api.tasks.*

open class GitHubListReleasesTask : GitHubTask() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.satori.libs.gradle.github

import com.satori.libs.gradle.utils.*
import org.gradle.api.*

open class GitHubPlugin : Plugin<Project> {

override fun apply(project: Project) {
project.addExtension("GitHubPublishReleaseTask", GitHubPublishReleaseTask::class.java)
project.addExtension("GitHubDeleteReleaseTask", GitHubDeleteReleaseTask::class.java)
project.addExtension("GitHubListReleasesTask", GitHubListReleasesTask::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.satori.libs.gradle.github

import com.damnhandy.uri.template.*
import com.fasterxml.jackson.annotation.*
import org.gradle.api.*
Expand Down Expand Up @@ -61,7 +63,7 @@ open class GitHubPublishReleaseTask : GitHubTask() {
request("DELETE", "releases/${release["id"].asText()}").get()
}

val body = jsonTree(Request().apply {
val body = GitHubTask.jsonTree(Request().apply {
tagName = releaseTag
targetCommitish = releaseBranch
name = releaseName
Expand Down
Loading

0 comments on commit 53895b4

Please sign in to comment.