diff --git a/README.md b/README.md
index 08125c5..ffae110 100644
--- a/README.md
+++ b/README.md
@@ -43,10 +43,9 @@ Simplify development and distribution and embrace a more streamlined process.
The plugin is not available in Maven central yet, required to be installed locally
+Manual installation
----
-Install locally OIS core library
-
+Install locally OIS core library
1. Clone the [core library](https://github.com/attiasas/open-interactive-simulation-core)
```bash
git clone https://github.com/attiasas/open-interactive-simulation-core.git
@@ -55,15 +54,8 @@ The plugin is not available in Maven central yet, required to be installed local
```bash
./gradlew publishToMavenLocal
```
-
----
-
-
-
-
----
-Install locally the plugin
+Install locally the plugin
1. Clone this repository
```bash
git clone https://github.com/attiasas/open-interactive-simulation-deployer.git
@@ -73,9 +65,14 @@ The plugin is not available in Maven central yet, required to be installed local
./gradlew publishToMavenLocal
```
----
+Download the installation bash [script](src/main/resources/installOIS.sh) and run it:
+```bash
+./installOIS.sh
+```
+
+---
1. Add at the top of your `settings.gradle` the following snippet
```groovy
pluginManagement {
@@ -138,10 +135,7 @@ For instance:
"Green" : "org.example.GreenState"
},
"publish" : {
- "platforms" : [ "Desktop" ],
-
- "publishedName" : "optional-published-project-name",
- "iconsDir" : "optional-path-to-your-icon-directory"
+ "platforms" : [ "Desktop" ]
}
}
```
diff --git a/src/main/resources/installOIS.sh b/src/main/resources/installOIS.sh
new file mode 100644
index 0000000..6e3fd3c
--- /dev/null
+++ b/src/main/resources/installOIS.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# Determine the operating system
+if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+ OS="linux"
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ OS="mac"
+elif [[ "$OSTYPE" == "cygwin" ]]; then
+ OS="windows"
+elif [[ "$OSTYPE" == "msys" ]]; then
+ OS="windows"
+elif [[ "$OSTYPE" == "win32" ]]; then
+ OS="windows"
+else
+ OS="unknown"
+fi
+
+# Set the base directory for cloning
+base_dir="$HOME/.ois"
+mkdir -p "$base_dir"
+
+# Define the tags for cloning
+CORE_TAG="master"
+DEPLOYER_TAG="master"
+
+# Function to check if directory exists and is not empty
+directory_exists_and_not_empty() {
+ dir_path=$1
+
+ if [ -d "$dir_path" ] && [ -n "$(ls -A "$dir_path")" ]; then
+ return 0 # Directory exists and is not empty
+ else
+ return 1 # Directory doesn't exist or is empty
+ fi
+}
+
+# Function to clone and publish a repository to Maven Local
+clone_and_publish() {
+ repo_url=$1
+ tag=$2
+ repo_name=$(basename $repo_url .git)
+ clone_dir="$base_dir/$repo_name"
+
+ # Check if the directory exist and not empty
+ if directory_exists_and_not_empty "$clone_dir"; then
+ echo "$clone_dir exists and is not empty. Skipping cloning."
+ else
+ mkdir -p "$clone_dir"
+ echo "cloning $repo_url ${tag}."
+ # Clone the repository with the specified tag or master if not specified
+ git clone --branch ${tag} $repo_url "$clone_dir"
+ fi
+
+ cd "$clone_dir"
+
+ # Publish the repository to Maven Local
+ echo "publishing to mavenLocal $repo_url."
+ if [[ "$OS" == "windows" ]]; then
+ ./gradlew.bat publishToMavenLocal
+ else
+ ./gradlew publishToMavenLocal
+ fi
+
+ cd ..
+}
+
+# Clone and publish the core library
+clone_and_publish https://github.com/attiasas/open-interactive-simulation-core.git $CORE_TAG
+
+# Clone and publish the deployer repository
+clone_and_publish https://github.com/attiasas/open-interactive-simulation-deployer.git $DEPLOYER_TAG