Skip to content

Commit

Permalink
Add one more plugin!
Browse files Browse the repository at this point in the history
$ ./gradlew clean core-cli:shadowJar plugin-tostring:shadowJar plugin-onlyyear:shadowJar

$ java -jar core-cli/build/libs/core-cli-0.0.1-all.jar plugin-tostring/build/libs/plugin-tostring-0.0.1-all.jar plugin-onlyyear/build/libs/plugin-onlyyear-0.0.1-all.jar
  • Loading branch information
dmikurube committed May 26, 2017
1 parent 927cbaa commit 7a06d67
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions plugin-onlyyear/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
}
}

apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
// DO NOT DEPEND ON core-impl!
compile project(':core-iface')
compile 'joda-time:joda-time:2.9.9' // Example: different version from core-impl.
}

shadowJar {
dependencies {
exclude(project(':core-iface'))
}
}
8 changes: 8 additions & 0 deletions plugin-onlyyear/src/main/java/Plugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import org.joda.time.DateTime;

public class Plugin implements PluginSpi {
@Override
public String formatTimestamp(Timestamp timestamp) {
return "" + new DateTime(timestamp.getEpoch() * 1000).getYear();
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ rootProject.name = 'clean-pluggable-example'
include 'core-iface'
include 'core-impl'
include 'core-cli'
include 'plugin-onlyyear'
include 'plugin-tostring'

0 comments on commit 7a06d67

Please sign in to comment.