-
Notifications
You must be signed in to change notification settings - Fork 3
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
akolomentsev
committed
Apr 20, 2018
1 parent
83e4c7a
commit 5f5c6db
Showing
27 changed files
with
312 additions
and
93 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 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 @@ | ||
/meta-info/ |
11 changes: 11 additions & 0 deletions
11
gradle-composer-plugin/ComposerPluginConvention.template.kt
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,11 @@ | ||
// auto generated | ||
// don't modify | ||
package com.satori.gradle.composer.plugin | ||
|
||
import org.gradle.api.* | ||
|
||
open class ${model.className}(val project: Project) { | ||
<% rootProject.publishingProjects.forEach { p->%> | ||
fun ${codeFormatter.methodName(p.name)}() = "${p.group}:satori-${p.name}:${p.version}" | ||
<% } %> | ||
} |
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 @@ | ||
apply from: rootProject.file('metainfo.gradle') | ||
apply from: rootProject.file('readme.gradle') | ||
|
||
task generateComposerPluginConvention(type: TransformTask){ | ||
description "generate meta information class" | ||
|
||
generateCode.dependsOn it | ||
|
||
def outputDir = file("gen") | ||
def className = "ComposerPluginConvention" | ||
def classFile = new File(outputDir, "$pckgDir/${className}.kt") | ||
|
||
template file("${className}.template.kt") | ||
output = classFile | ||
model.className = className | ||
|
||
inputs.file(rootProject.file("gradle.properties")) | ||
inputs.file(template) | ||
outputs.file(output) | ||
|
||
project.sourceSets.main.java.srcDirs += outputDir | ||
|
||
clean.doFirst { | ||
delete(outputDir) | ||
} | ||
} | ||
|
||
// main dependencies | ||
dependencies { | ||
compile project(":libs-gradle-utils") | ||
|
||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" | ||
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" | ||
|
||
compile gradleApi() | ||
} | ||
|
||
// test dependencies | ||
dependencies { | ||
testCompile project(':libs-testlib') | ||
testCompile gradleTestKit() | ||
} |
49 changes: 49 additions & 0 deletions
49
gradle-composer-plugin/gen/com/satori/gradle/composer/plugin/ComposerPluginConvention.kt
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,49 @@ | ||
// auto generated | ||
// don't modify | ||
package com.satori.gradle.composer.plugin | ||
|
||
import org.gradle.api.* | ||
|
||
open class ComposerPluginConvention(val project: Project) { | ||
|
||
fun gradleComposerPlugin() = "com.satori:satori-gradle-composer-plugin:0.5.67-SNAPSHOT" | ||
|
||
fun composer() = "com.satori:satori-composer:0.5.67-SNAPSHOT" | ||
|
||
fun mods() = "com.satori:satori-mods:0.5.67-SNAPSHOT" | ||
|
||
fun modsSuite() = "com.satori:satori-mods-suite:0.5.67-SNAPSHOT" | ||
|
||
fun libsAsyncApi() = "com.satori:satori-libs-async-api:0.5.67-SNAPSHOT" | ||
|
||
fun libsAsyncCore() = "com.satori:satori-libs-async-core:0.5.67-SNAPSHOT" | ||
|
||
fun libsAsyncKotlin() = "com.satori:satori-libs-async-kotlin:0.5.67-SNAPSHOT" | ||
|
||
fun libsCommonKotlin() = "com.satori:satori-libs-common-kotlin:0.5.67-SNAPSHOT" | ||
|
||
fun libsVertxKotlin() = "com.satori:satori-libs-vertx-kotlin:0.5.67-SNAPSHOT" | ||
|
||
fun libsGtfs() = "com.satori:satori-libs-gtfs:0.5.67-SNAPSHOT" | ||
|
||
fun libsCompositionDrawer() = "com.satori:satori-libs-composition-drawer:0.5.67-SNAPSHOT" | ||
|
||
fun libsGradleUtils() = "com.satori:satori-libs-gradle-utils:0.5.67-SNAPSHOT" | ||
|
||
fun libsGradleTransform() = "com.satori:satori-libs-gradle-transform:0.5.67-SNAPSHOT" | ||
|
||
fun libsGradleGithub() = "com.satori:satori-libs-gradle-github:0.5.67-SNAPSHOT" | ||
|
||
fun libsGradleDocker() = "com.satori:satori-libs-gradle-docker:0.5.67-SNAPSHOT" | ||
|
||
fun libsGradleCodegen() = "com.satori:satori-libs-gradle-codegen:0.5.67-SNAPSHOT" | ||
|
||
fun codegenUtils() = "com.satori:satori-codegen-utils:0.5.67-SNAPSHOT" | ||
|
||
fun codegenCodemodelDsl() = "com.satori:satori-codegen-codemodel-dsl:0.5.67-SNAPSHOT" | ||
|
||
fun codegenMustacheBuilder() = "com.satori:satori-codegen-mustache-builder:0.5.67-SNAPSHOT" | ||
|
||
fun codegenYamlFileMerger() = "com.satori:satori-codegen-yaml-file-merger:0.5.67-SNAPSHOT" | ||
|
||
} |
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,79 @@ | ||
[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-gradle-composer-plugin.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-gradle-composer-plugin/0.5.67-SNAPSHOT/) | ||
|
||
## Comoser Gradle plugin | ||
|
||
defines project extensions to simplify maintaining build system | ||
|
||
### apply plugin example | ||
|
||
```gradle | ||
buildscript{ | ||
repositories { | ||
mavenCentral() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots" } | ||
} | ||
dependencies { | ||
classpath "com.satori:satori-gradle-composer-plugin:0.5.67-SNAPSHOT" | ||
} | ||
} | ||
apply plugin: "com.satori.composer" | ||
``` | ||
|
||
### project extensions | ||
|
||
|
||
- `gradleComposerPlugin()` - returns `"com.satori:satori-gradle-composer-plugin:0.5.67-SNAPSHOT"` | ||
|
||
- `composer()` - returns `"com.satori:satori-composer:0.5.67-SNAPSHOT"` | ||
|
||
- `mods()` - returns `"com.satori:satori-mods:0.5.67-SNAPSHOT"` | ||
|
||
- `modsSuite()` - returns `"com.satori:satori-mods-suite:0.5.67-SNAPSHOT"` | ||
|
||
- `libsAsyncApi()` - returns `"com.satori:satori-libs-async-api:0.5.67-SNAPSHOT"` | ||
|
||
- `libsAsyncCore()` - returns `"com.satori:satori-libs-async-core:0.5.67-SNAPSHOT"` | ||
|
||
- `libsAsyncKotlin()` - returns `"com.satori:satori-libs-async-kotlin:0.5.67-SNAPSHOT"` | ||
|
||
- `libsCommonKotlin()` - returns `"com.satori:satori-libs-common-kotlin:0.5.67-SNAPSHOT"` | ||
|
||
- `libsVertxKotlin()` - returns `"com.satori:satori-libs-vertx-kotlin:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGtfs()` - returns `"com.satori:satori-libs-gtfs:0.5.67-SNAPSHOT"` | ||
|
||
- `libsCompositionDrawer()` - returns `"com.satori:satori-libs-composition-drawer:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGradleUtils()` - returns `"com.satori:satori-libs-gradle-utils:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGradleTransform()` - returns `"com.satori:satori-libs-gradle-transform:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGradleGithub()` - returns `"com.satori:satori-libs-gradle-github:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGradleDocker()` - returns `"com.satori:satori-libs-gradle-docker:0.5.67-SNAPSHOT"` | ||
|
||
- `libsGradleCodegen()` - returns `"com.satori:satori-libs-gradle-codegen:0.5.67-SNAPSHOT"` | ||
|
||
- `codegenUtils()` - returns `"com.satori:satori-codegen-utils:0.5.67-SNAPSHOT"` | ||
|
||
- `codegenCodemodelDsl()` - returns `"com.satori:satori-codegen-codemodel-dsl:0.5.67-SNAPSHOT"` | ||
|
||
- `codegenMustacheBuilder()` - returns `"com.satori:satori-codegen-mustache-builder:0.5.67-SNAPSHOT"` | ||
|
||
- `codegenYamlFileMerger()` - returns `"com.satori:satori-codegen-yaml-file-merger:0.5.67-SNAPSHOT"` | ||
|
||
|
||
|
||
### Maven (snapshots) | ||
```xml | ||
<repository> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> | ||
</repository> | ||
``` | ||
```xml | ||
<dependency> | ||
<groupId>com.satori</groupId> | ||
<artifactId>satori-gradle-composer-plugin</artifactId> | ||
<version>0.5.67-SNAPSHOT</version> | ||
</dependency> | ||
``` |
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,51 @@ | ||
[![Maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.satori/satori-${project.name}.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/satori/satori-${project.name}/${project.version}/) | ||
|
||
## Comoser Gradle plugin | ||
|
||
defines project extensions to simplify maintaining build system | ||
|
||
### apply plugin example | ||
|
||
```gradle | ||
buildscript{ | ||
repositories { | ||
mavenCentral() | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots" } | ||
} | ||
dependencies { | ||
classpath "com.satori:satori-${project.name}:${project.version}" | ||
} | ||
} | ||
apply plugin: "com.satori.composer" | ||
``` | ||
|
||
### project extensions | ||
|
||
<% rootProject.publishingProjects.forEach { p->%> | ||
- `${codeFormatter.methodName(p.name)}()` - returns `"${p.group}:satori-${p.name}:${p.version}"` | ||
<% } %> | ||
|
||
<% if(!project.version.endsWith("-SNAPSHOT")) {%> | ||
### Maven (releases) | ||
```xml | ||
<dependency> | ||
<groupId>${project.group}</groupId> | ||
<artifactId>satori-${project.name}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
``` | ||
<% } else {%> | ||
### Maven (snapshots) | ||
```xml | ||
<repository> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> | ||
</repository> | ||
``` | ||
```xml | ||
<dependency> | ||
<groupId>${project.group}</groupId> | ||
<artifactId>satori-${project.name}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
``` | ||
<% }%> |
1 change: 1 addition & 0 deletions
1
gradle-composer-plugin/res/META-INF/gradle-plugins/com.satori.composer.properties
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 @@ | ||
implementation-class=com.satori.gradle.composer.plugin.ComposerPlugin |
11 changes: 11 additions & 0 deletions
11
gradle-composer-plugin/src/com/satori/gradle/composer/plugin/ComposerPlugin.kt
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,11 @@ | ||
package com.satori.gradle.composer.plugin | ||
|
||
import org.gradle.api.* | ||
|
||
open class ComposerPlugin() : Plugin<Project> { | ||
|
||
override fun apply(project: Project) { | ||
val conv = ComposerPluginConvention(project) | ||
project.convention.plugins["composer"] = conv | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
gradle-composer-plugin/tests/src/com/satori/gradle/composer/plugin/ComposerPluginTests.kt
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,19 @@ | ||
package com.satori.gradle.composer.plugin | ||
|
||
import org.codehaus.groovy.runtime.* | ||
import org.gradle.testfixtures.* | ||
import org.junit.* | ||
|
||
class ComposerPluginTests : Assert() { | ||
|
||
@Test | ||
public fun `validate project extentions`() { | ||
val project = ProjectBuilder.builder().build() | ||
project.pluginManager.apply("com.satori.composer") | ||
|
||
assertEquals( | ||
"com.satori:satori-composer:${MetaInfo.version}", | ||
InvokerHelper.invokeMethod(project, "composer", null) | ||
) | ||
} | ||
} |
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
Oops, something went wrong.