aboutsummaryrefslogtreecommitdiffstats
path: root/demo_gradle/plugins
diff options
context:
space:
mode:
authorMichael "Lyze" Weinberger <michael.weinberger@lyze.at>2017-06-19 10:41:58 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2017-06-19 11:41:58 +0300
commita9c70ff19adf06c940f925a3c09e1a3dee7aa9a4 (patch)
treec97a6d65608082663b52c342c5aa149ee5808f3f /demo_gradle/plugins
parent443191d0cc75079099278596c686c29d18cf9a01 (diff)
downloadpf4j-a9c70ff19adf06c940f925a3c09e1a3dee7aa9a4.tar.gz
pf4j-a9c70ff19adf06c940f925a3c09e1a3dee7aa9a4.zip
Updated gradle demo dependencies and switched from System.out.println to slf4j.log (#149)
Diffstat (limited to 'demo_gradle/plugins')
-rw-r--r--demo_gradle/plugins/plugin1/build.gradle6
-rw-r--r--demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java9
-rw-r--r--demo_gradle/plugins/plugin2/build.gradle6
-rw-r--r--demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java7
-rw-r--r--demo_gradle/plugins/plugin3/build.gradle6
-rw-r--r--demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt8
6 files changed, 28 insertions, 14 deletions
diff --git a/demo_gradle/plugins/plugin1/build.gradle b/demo_gradle/plugins/plugin1/build.gradle
index fc620e6..596101e 100644
--- a/demo_gradle/plugins/plugin1/build.gradle
+++ b/demo_gradle/plugins/plugin1/build.gradle
@@ -24,7 +24,9 @@ assemble.dependsOn plugin
dependencies {
compileOnly project(':api') // compileOnly important!!! We do not want to put the api into the zip file since the main program has it already!
- compile 'ro.fortsoft.pf4j:pf4j:1.1.1'
- compile 'org.apache.commons:commons-lang3:3.0'
+ compile ('ro.fortsoft.pf4j:pf4j:1.3.0') {
+ exclude group: "org.slf4j"
+ }
+ compile 'org.apache.commons:commons-lang3:3.5'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
diff --git a/demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java b/demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java
index 5ba9f81..46ca250 100644
--- a/demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java
+++ b/demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java
@@ -17,6 +17,8 @@ package ro.fortsoft.pf4j.demo.welcome;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import ro.fortsoft.pf4j.Extension;
import ro.fortsoft.pf4j.Plugin;
import ro.fortsoft.pf4j.PluginWrapper;
@@ -26,6 +28,7 @@ import ro.fortsoft.pf4j.demo.api.Greeting;
* @author Decebal Suiu
*/
public class WelcomePlugin extends Plugin {
+ private static final Logger logger = LoggerFactory.getLogger(WelcomePlugin.class);
public WelcomePlugin(PluginWrapper wrapper) {
super(wrapper);
@@ -33,13 +36,13 @@ public class WelcomePlugin extends Plugin {
@Override
public void start() {
- System.out.println("WelcomePlugin.start()");
- System.out.println(StringUtils.upperCase("WelcomePlugin"));
+ logger.info("WelcomePlugin.start()");
+ logger.info(StringUtils.upperCase("WelcomePlugin"));
}
@Override
public void stop() {
- System.out.println("WelcomePlugin.stop()");
+ logger.info("WelcomePlugin.stop()");
}
@Extension
diff --git a/demo_gradle/plugins/plugin2/build.gradle b/demo_gradle/plugins/plugin2/build.gradle
index a13bfec..3a96d1e 100644
--- a/demo_gradle/plugins/plugin2/build.gradle
+++ b/demo_gradle/plugins/plugin2/build.gradle
@@ -24,7 +24,9 @@ assemble.dependsOn plugin
dependencies {
compileOnly project(':api') // compileOnly important!!! We do not want to put the api into the zip file since the main program has it already!
- compile 'ro.fortsoft.pf4j:pf4j:1.1.1'
- compile 'org.apache.commons:commons-lang3:3.0'
+ compile ('ro.fortsoft.pf4j:pf4j:1.3.0') {
+ exclude group: "org.slf4j"
+ }
+ compile 'org.apache.commons:commons-lang3:3.5'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
diff --git a/demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java b/demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java
index b5e5392..82c0046 100644
--- a/demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java
+++ b/demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java
@@ -15,6 +15,8 @@
*/
package ro.fortsoft.pf4j.demo.hello;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import ro.fortsoft.pf4j.Extension;
import ro.fortsoft.pf4j.Plugin;
import ro.fortsoft.pf4j.PluginWrapper;
@@ -26,6 +28,7 @@ import ro.fortsoft.pf4j.demo.api.Greeting;
* @author Decebal Suiu
*/
public class HelloPlugin extends Plugin {
+ private static final Logger logger = LoggerFactory.getLogger(HelloPlugin.class);
public HelloPlugin(PluginWrapper wrapper) {
super(wrapper);
@@ -33,12 +36,12 @@ public class HelloPlugin extends Plugin {
@Override
public void start() {
- System.out.println("HelloPlugin.start()");
+ logger.info("HelloPlugin.start()");
}
@Override
public void stop() {
- System.out.println("HelloPlugin.stop()");
+ logger.info("HelloPlugin.stop()");
}
@Extension(ordinal=1)
diff --git a/demo_gradle/plugins/plugin3/build.gradle b/demo_gradle/plugins/plugin3/build.gradle
index 8596512..d77258e 100644
--- a/demo_gradle/plugins/plugin3/build.gradle
+++ b/demo_gradle/plugins/plugin3/build.gradle
@@ -42,8 +42,10 @@ repositories {
dependencies {
compileOnly project(':api')
- kapt 'ro.fortsoft.pf4j:pf4j:1.+'
- compile 'org.apache.commons:commons-lang3:3.0'
+ kapt ('ro.fortsoft.pf4j:pf4j:1.3.0') {
+ exclude group: "org.slf4j"
+ }
+ compile 'org.apache.commons:commons-lang3:3.5'
testCompile group: 'junit', name: 'junit', version: '4.+'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
}
diff --git a/demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt b/demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt
index c6a317e..f8df469 100644
--- a/demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt
+++ b/demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt
@@ -16,6 +16,7 @@
package ro.fortsoft.pf4j.demo.kotlin
import org.apache.commons.lang3.StringUtils
+import org.slf4j.LoggerFactory
import ro.fortsoft.pf4j.Extension
import ro.fortsoft.pf4j.Plugin
import ro.fortsoft.pf4j.PluginWrapper
@@ -27,14 +28,15 @@ import ro.fortsoft.pf4j.demo.api.Greeting
* @author Anindya Chatterjee
*/
class KotlinPlugin(wrapper: PluginWrapper) : Plugin(wrapper) {
+ private val logger = LoggerFactory.getLogger(KotlinPlugin::class.java)
override fun start() {
- println("KotlinPlugin.start()")
- println(StringUtils.upperCase("KotlinPlugin"))
+ logger.info("KotlinPlugin.start()")
+ logger.info(StringUtils.upperCase("KotlinPlugin"))
}
override fun stop() {
- println("KotlinPlugin.stop()")
+ logger.info("KotlinPlugin.stop()")
}
}