You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2021/09/14 10:03:01 UTC

[sling-org-apache-sling-starter] 01/01: Add some helper scripts

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch issue/helpers
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git

commit cfd1f28e7a31c201b232ea9243f5664ea62dba26
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Sep 14 12:02:44 2021 +0200

    Add some helper scripts
---
 README.md              |  4 ++++
 scripts/oak-run.sh     | 27 +++++++++++++++++++++++++++
 scripts/oak-upgrade.sh | 27 +++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/README.md b/README.md
index f19a2b4..ac5d860 100644
--- a/README.md
+++ b/README.md
@@ -55,3 +55,7 @@ For instance, launching an empty Sling Starter with segment persistence can be a
     java -jar target/dependency/org.apache.sling.feature.launcher.jar -f target/slingfeature-tmp/feature-nosample_base.json,target/slingfeature-tmp/feature-oak_persistence_sns.json
     
 Your own feature files can be added to the feature list.
+
+## Helper scripts
+
+The `scripts` directory contains helper scripts that will aid with local development by simplifying the use of tools external to the Sling Starter.
diff --git a/scripts/oak-run.sh b/scripts/oak-run.sh
new file mode 100755
index 0000000..6a47c6a
--- /dev/null
+++ b/scripts/oak-run.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+oak_version=$(cat pom.xml | sed -n 's/.*<oak\.version>\(.*\)<\/oak\.version>.*/\1/p')
+oak_run_jar=$HOME/.m2/repository/org/apache/jackrabbit/oak-run/${oak_version}/oak-run-${oak_version}.jar
+if [ ! -f ${oak_run_jar} ]; then
+    mvn -q dependency:get -Dartifact=org.apache.jackrabbit:oak-run:${oak_version} -Dtransitive=false
+fi
+
+java -Dswing.systemlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -jar ${oak_run_jar} "$@"
diff --git a/scripts/oak-upgrade.sh b/scripts/oak-upgrade.sh
new file mode 100755
index 0000000..e3a7d11
--- /dev/null
+++ b/scripts/oak-upgrade.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+oak_version=$(cat pom.xml | sed -n 's/.*<oak\.version>\(.*\)<\/oak\.version>.*/\1/p')
+oak_run_jar=$HOME/.m2/repository/org/apache/jackrabbit/oak-upgrade/${oak_version}/oak-upgrade-${oak_version}.jar
+if [ ! -f ${oak_run_jar} ]; then
+    mvn -q dependency:get -Dartifact=org.apache.jackrabbit:oak-upgrade:${oak_version} -Dtransitive=false
+fi
+
+java -jar ${oak_run_jar} "$@"