From 5916ee64d9c05a4f085f6f6562ed383ff3203e4a Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 20 Sep 2017 16:55:30 +0200 Subject: Change root package from ro.fortsoft.pf4j to org.pf4j (#168) --- demo_gradle/plugins/plugin1/build.gradle | 39 ++++++++------- demo_gradle/plugins/plugin1/plugin.properties | 2 +- .../java/org/pf4j/demo/welcome/WelcomePlugin.java | 58 ++++++++++++++++++++++ .../fortsoft/pf4j/demo/welcome/WelcomePlugin.java | 58 ---------------------- demo_gradle/plugins/plugin2/build.gradle | 47 +++++++++--------- demo_gradle/plugins/plugin2/plugin.properties | 2 +- .../main/java/org/pf4j/demo/hello/HelloPlugin.java | 57 +++++++++++++++++++++ .../ro/fortsoft/pf4j/demo/hello/HelloPlugin.java | 57 --------------------- demo_gradle/plugins/plugin3/build.gradle | 14 +++--- .../kotlin/org/pf4j/demo/kotlin/KotlinPlugin.kt | 48 ++++++++++++++++++ .../ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt | 48 ------------------ 11 files changed, 216 insertions(+), 214 deletions(-) create mode 100644 demo_gradle/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java delete mode 100644 demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java create mode 100644 demo_gradle/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java delete mode 100644 demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java create mode 100644 demo_gradle/plugins/plugin3/src/main/kotlin/org/pf4j/demo/kotlin/KotlinPlugin.kt delete mode 100644 demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt (limited to 'demo_gradle/plugins') diff --git a/demo_gradle/plugins/plugin1/build.gradle b/demo_gradle/plugins/plugin1/build.gradle index 596101e..f0998a1 100644 --- a/demo_gradle/plugins/plugin1/build.gradle +++ b/demo_gradle/plugins/plugin1/build.gradle @@ -2,31 +2,32 @@ jar { baseName = 'WelcomePlugin' version = '0.1.0' manifest { - attributes 'Plugin-Class' : 'ro.fortsoft.pf4j.demo.welcome.WelcomePlugin', - 'Plugin-Id' : 'WelcomePlugin', - 'Plugin-Version' : '1.0.0', - 'Plugin-Provider' : 'Decebal Suiu' + attributes 'Plugin-Class': 'org.pf4j.demo.welcome.WelcomePlugin', + 'Plugin-Id': 'WelcomePlugin', + 'Plugin-Version': '1.0.0', + 'Plugin-Provider': 'Decebal Suiu' } } task plugin(type: Jar) { - baseName = 'WelcomePlugin' - version = '0.1.0' - into('classes'){ - with jar - } - into('lib'){ - from configurations.compile - } - extension('zip') + baseName = 'WelcomePlugin' + version = '0.1.0' + into('classes') { + with jar + } + into('lib') { + from configurations.compile + } + extension('zip') } 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.3.0') { - exclude group: "org.slf4j" - } - compile 'org.apache.commons:commons-lang3:3.5' - testCompile group: 'junit', name: 'junit', version: '4.+' + 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('org.pf4j:pf4j:1.4.0-SNAPSHOT') { + 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/plugin.properties b/demo_gradle/plugins/plugin1/plugin.properties index 4f95d99..9da9bcc 100644 --- a/demo_gradle/plugins/plugin1/plugin.properties +++ b/demo_gradle/plugins/plugin1/plugin.properties @@ -1,5 +1,5 @@ plugin.id=welcome-plugin -plugin.class=ro.fortsoft.pf4j.demo.welcome.WelcomePlugin +plugin.class=org.pf4j.demo.welcome.WelcomePlugin plugin.version=0.0.1 plugin.provider=Decebal Suiu plugin.dependencies= diff --git a/demo_gradle/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java b/demo_gradle/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java new file mode 100644 index 0000000..040c9fd --- /dev/null +++ b/demo_gradle/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java @@ -0,0 +1,58 @@ +/* + * Copyright 2012 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.pf4j.demo.welcome; + +import org.apache.commons.lang3.StringUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.pf4j.Extension; +import org.pf4j.Plugin; +import org.pf4j.PluginWrapper; +import org.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); + } + + @Override + public void start() { + logger.info("WelcomePlugin.start()"); + logger.info(StringUtils.upperCase("WelcomePlugin")); + } + + @Override + public void stop() { + logger.info("WelcomePlugin.stop()"); + } + + @Extension + public static class WelcomeGreeting implements Greeting { + + @Override + public String getGreeting() { + return "Welcome"; + } + + } + +} 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 deleted file mode 100644 index 46ca250..0000000 --- a/demo_gradle/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2012 Decebal Suiu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -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; -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); - } - - @Override - public void start() { - logger.info("WelcomePlugin.start()"); - logger.info(StringUtils.upperCase("WelcomePlugin")); - } - - @Override - public void stop() { - logger.info("WelcomePlugin.stop()"); - } - - @Extension - public static class WelcomeGreeting implements Greeting { - - @Override - public String getGreeting() { - return "Welcome"; - } - - } - -} diff --git a/demo_gradle/plugins/plugin2/build.gradle b/demo_gradle/plugins/plugin2/build.gradle index 3a96d1e..0e292fb 100644 --- a/demo_gradle/plugins/plugin2/build.gradle +++ b/demo_gradle/plugins/plugin2/build.gradle @@ -1,32 +1,33 @@ jar { - baseName = 'HelloPlugin' - version = '0.1.0' - manifest { - attributes 'Plugin-Class' : 'ro.fortsoft.pf4j.demo.hello.HelloPlugin', - 'Plugin-Id' : 'HelloPlugin', - 'Plugin-Version' : '1.0.0', - 'Plugin-Provider' : 'Decebal Suiu' - } + baseName = 'HelloPlugin' + version = '0.1.0' + manifest { + attributes 'Plugin-Class': 'org.pf4j.demo.hello.HelloPlugin', + 'Plugin-Id': 'HelloPlugin', + 'Plugin-Version': '1.0.0', + 'Plugin-Provider': 'Decebal Suiu' + } } task plugin(type: Jar) { - baseName = 'HelloPlugin' - version = '0.1.0' - into('classes'){ - with jar - } - into('lib'){ - from configurations.compile - } - extension('zip') + baseName = 'HelloPlugin' + version = '0.1.0' + into('classes') { + with jar + } + into('lib') { + from configurations.compile + } + extension('zip') } 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.3.0') { - exclude group: "org.slf4j" - } - compile 'org.apache.commons:commons-lang3:3.5' - testCompile group: 'junit', name: 'junit', version: '4.+' + 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('org.pf4j:pf4j:1.4.0-SNAPSHOT') { + 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/plugin.properties b/demo_gradle/plugins/plugin2/plugin.properties index 0de45e6..60b6f33 100644 --- a/demo_gradle/plugins/plugin2/plugin.properties +++ b/demo_gradle/plugins/plugin2/plugin.properties @@ -1,5 +1,5 @@ plugin.id=hello-plugin -plugin.class=ro.fortsoft.pf4j.demo.hello.HelloPlugin +plugin.class=org.pf4j.demo.hello.HelloPlugin plugin.version=0.0.1 plugin.provider=Decebal Suiu plugin.dependencies= diff --git a/demo_gradle/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java b/demo_gradle/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java new file mode 100644 index 0000000..f8e83d3 --- /dev/null +++ b/demo_gradle/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java @@ -0,0 +1,57 @@ +/* + * Copyright 2012 Decebal Suiu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.pf4j.demo.hello; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.pf4j.Extension; +import org.pf4j.Plugin; +import org.pf4j.PluginWrapper; +import org.pf4j.demo.api.Greeting; + +/** + * A very simple plugin. + * + * @author Decebal Suiu + */ +public class HelloPlugin extends Plugin { + private static final Logger logger = LoggerFactory.getLogger(HelloPlugin.class); + + public HelloPlugin(PluginWrapper wrapper) { + super(wrapper); + } + + @Override + public void start() { + logger.info("HelloPlugin.start()"); + } + + @Override + public void stop() { + logger.info("HelloPlugin.stop()"); + } + + @Extension(ordinal=1) + public static class HelloGreeting implements Greeting { + + @Override + public String getGreeting() { + return "Hello"; + } + + } + +} 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 deleted file mode 100644 index 82c0046..0000000 --- a/demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2012 Decebal Suiu - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -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; -import ro.fortsoft.pf4j.demo.api.Greeting; - -/** - * A very simple plugin. - * - * @author Decebal Suiu - */ -public class HelloPlugin extends Plugin { - private static final Logger logger = LoggerFactory.getLogger(HelloPlugin.class); - - public HelloPlugin(PluginWrapper wrapper) { - super(wrapper); - } - - @Override - public void start() { - logger.info("HelloPlugin.start()"); - } - - @Override - public void stop() { - logger.info("HelloPlugin.stop()"); - } - - @Extension(ordinal=1) - public static class HelloGreeting implements Greeting { - - @Override - public String getGreeting() { - return "Hello"; - } - - } - -} diff --git a/demo_gradle/plugins/plugin3/build.gradle b/demo_gradle/plugins/plugin3/build.gradle index d77258e..7dd77dc 100644 --- a/demo_gradle/plugins/plugin3/build.gradle +++ b/demo_gradle/plugins/plugin3/build.gradle @@ -13,20 +13,20 @@ jar { baseName = 'KotlinPlugin' version = '0.1.0' manifest { - attributes 'Plugin-Class' : 'ro.fortsoft.pf4j.demo.kotlin.KotlinPlugin', - 'Plugin-Id' : 'KotlinPlugin', - 'Plugin-Version' : '1.0.0', - 'Plugin-Provider' : 'Anindya Chatterjee' + attributes 'Plugin-Class': 'org.pf4j.demo.kotlin.KotlinPlugin', + 'Plugin-Id': 'KotlinPlugin', + 'Plugin-Version': '1.0.0', + 'Plugin-Provider': 'Anindya Chatterjee' } } task plugin(type: Jar) { baseName = 'KotlinPlugin' version = '0.1.0' - into('classes'){ + into('classes') { with jar } - into('lib'){ + into('lib') { from configurations.compile } extension('zip') @@ -42,7 +42,7 @@ repositories { dependencies { compileOnly project(':api') - kapt ('ro.fortsoft.pf4j:pf4j:1.3.0') { + kapt('org.pf4j:pf4j:1.4.0-SNAPSHOT') { exclude group: "org.slf4j" } compile 'org.apache.commons:commons-lang3:3.5' diff --git a/demo_gradle/plugins/plugin3/src/main/kotlin/org/pf4j/demo/kotlin/KotlinPlugin.kt b/demo_gradle/plugins/plugin3/src/main/kotlin/org/pf4j/demo/kotlin/KotlinPlugin.kt new file mode 100644 index 0000000..2b2bc17 --- /dev/null +++ b/demo_gradle/plugins/plugin3/src/main/kotlin/org/pf4j/demo/kotlin/KotlinPlugin.kt @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.pf4j.demo.kotlin + +import org.apache.commons.lang3.StringUtils +import org.slf4j.LoggerFactory +import org.pf4j.Extension +import org.pf4j.Plugin +import org.pf4j.PluginWrapper +import org.pf4j.demo.api.Greeting + +/** + * A sample plugin written in Kotlin + * + * @author Anindya Chatterjee + */ +class KotlinPlugin(wrapper: PluginWrapper) : Plugin(wrapper) { + private val logger = LoggerFactory.getLogger(KotlinPlugin::class.java) + + override fun start() { + logger.info("KotlinPlugin.start()") + logger.info(StringUtils.upperCase("KotlinPlugin")) + } + + override fun stop() { + logger.info("KotlinPlugin.stop()") + } +} + +@Extension +class KotlinGreeting : Greeting { + override fun getGreeting(): String { + return "KotlinGreetings" + } +} 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 deleted file mode 100644 index f8df469..0000000 --- a/demo_gradle/plugins/plugin3/src/main/kotlin/ro/fortsoft/pf4j/demo/kotlin/KotlinPlugin.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -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 -import ro.fortsoft.pf4j.demo.api.Greeting - -/** - * A sample plugin written in Kotlin - * - * @author Anindya Chatterjee - */ -class KotlinPlugin(wrapper: PluginWrapper) : Plugin(wrapper) { - private val logger = LoggerFactory.getLogger(KotlinPlugin::class.java) - - override fun start() { - logger.info("KotlinPlugin.start()") - logger.info(StringUtils.upperCase("KotlinPlugin")) - } - - override fun stop() { - logger.info("KotlinPlugin.stop()") - } -} - -@Extension -class KotlinGreeting : Greeting { - override fun getGreeting(): String { - return "KotlinGreetings" - } -} -- cgit v1.2.3