From 13d05bc8458758ee39cb829098241e89616717ee Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Wed, 9 Sep 2015 22:15:21 -0700 Subject: ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60 Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd --- .../src/onos/tools/package/archetypes/cli/pom.xml | 32 ++++++ .../META-INF/maven/archetype-metadata.xml | 36 ++++++ .../src/main/resources/archetype-resources/pom.xml | 126 +++++++++++++++++++++ .../src/main/java/AppCommand.java | 33 ++++++ .../resources/OSGI-INF/blueprint/shell-config.xml | 24 ++++ .../resources/projects/basic/archetype.properties | 21 ++++ .../cli/src/test/resources/projects/basic/goal.txt | 0 7 files changed, 272 insertions(+) create mode 100644 framework/src/onos/tools/package/archetypes/cli/pom.xml create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/shell-config.xml create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties create mode 100644 framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/goal.txt (limited to 'framework/src/onos/tools/package/archetypes/cli') diff --git a/framework/src/onos/tools/package/archetypes/cli/pom.xml b/framework/src/onos/tools/package/archetypes/cli/pom.xml new file mode 100644 index 00000000..1ab9c1f2 --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + + + org.onosproject + onos-archetypes + 1.3.0-SNAPSHOT + + + onos-cli-archetype + maven-archetype + + onos-cli-archetype + ONOS Apache Karaf bundle archetype + + diff --git a/framework/src/onos/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..8558d476 --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,36 @@ + + + + + + src/main/java + + **/*.java + + + + src/main/resources + + **/*.xml + + + + diff --git a/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..cb3862c3 --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,126 @@ + + + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + bundle + + ONOS OSGi bundle archetype + http://onosproject.org + + + 1.3.0-SNAPSHOT + + + + + org.onosproject + onos-api + ${onos.version} + + + + org.onosproject + onlab-osgi + ${onos.version} + + + + junit + junit + 4.11 + test + + + + org.onosproject + onos-cli + ${onos.version} + provided + + + + org.onosproject + onos-api + ${onos.version} + test + tests + + + + org.osgi + org.osgi.core + 4.3.1 + provided + + + org.apache.felix + org.apache.felix.scr.annotations + 1.9.8 + provided + + + org.apache.karaf.shell + org.apache.karaf.shell.console + 3.0.3 + provided + + + + + + + org.apache.felix + maven-bundle-plugin + 2.5.3 + true + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + 1.8 + 1.8 + + + + org.apache.felix + maven-scr-plugin + 1.20.0 + + + generate-scr-srcdescriptor + + scr + + + + + + bundle + war + + + + + + + diff --git a/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java new file mode 100644 index 00000000..9262b2e4 --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/java/AppCommand.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014 Open Networking Laboratory + * + * 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 ${package}; + +import org.apache.karaf.shell.commands.Command; +import org.onosproject.cli.AbstractShellCommand; + +/** + * Sample Apache Karaf CLI command + */ +@Command(scope = "onos", name = "sample", + description = "Sample Apache Karaf CLI command") +public class AppCommand extends AbstractShellCommand { + + @Override + protected void execute() { + print("Hello %s", "World"); + } + +} diff --git a/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/shell-config.xml new file mode 100644 index 00000000..202ab9ed --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/src/main/resources/archetype-resources/src/main/resources/OSGI-INF/blueprint/shell-config.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties b/framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties new file mode 100644 index 00000000..a1213b40 --- /dev/null +++ b/framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/archetype.properties @@ -0,0 +1,21 @@ +# +# Copyright 2014 Open Networking Laboratory +# +# 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. +# + +#Thu Dec 04 09:24:50 PST 2014 +package=it.pkg +version=0.1-SNAPSHOT +groupId=archetype.it +artifactId=basic diff --git a/framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/goal.txt b/framework/src/onos/tools/package/archetypes/cli/src/test/resources/projects/basic/goal.txt new file mode 100644 index 00000000..e69de29b -- cgit 1.2.3-korg