Skip to content

Commit

Permalink
Scripts: minor fixes (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
pklatka authored Apr 17, 2024
1 parent c237738 commit 314e7c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 4 additions & 6 deletions packages/turbo/scripts/build-turbo-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ if [ -z "$TURBO_ANDROID_VERSION" ]
exit 1
fi

echo "turbo-android version: $TURBO_ANDROID_VERSION"

cd $TURBO_ANDROID_DIR
rm -rf vendor
mkdir vendor
Expand All @@ -27,20 +25,21 @@ git clone --branch $TURBO_ANDROID_VERSION --depth 1 $TURBO_ANDROID_REPO_PATH
cd turbo-android
git apply $PATCH_FILE

# Build turbo-android to local maven repository
# Publish turbo-android to local maven repository
./gradlew -PVersion=local publishToMavenLocal

# Build turbo-android to vendor directory
# Publish turbo-android to vendor directory
./gradlew -Dmaven.repo.local=$TURBO_ANDROID_DIR/vendor -PVersion=local publishToMavenLocal

# Get necessary dependencies from turbo build.gradle
# Get necessary dependencies from turbo-android build.gradle file
./gradlew turbo:dependencies --configuration implementation > deps.txt
./gradlew turbo:dependencies --configuration api > apis.txt

# Get turbo-android dependencies and create DEPENDENCIES_GRADLE_FILE
cd ..
rm -rf $DEPENDENCIES_GRADLE_FILE
touch $DEPENDENCIES_GRADLE_FILE

echo "ext {\n\tdeps = [ " > $DEPENDENCIES_GRADLE_FILE
grep -oE $DEPENDENCY_REGEX ./turbo-android/deps.txt | awk '{print "\t\tdep" NR ": " "\""$1"\"" ","}' >> $DEPENDENCIES_GRADLE_FILE
echo "\t]\n\tapis = [" >> $DEPENDENCIES_GRADLE_FILE
Expand All @@ -49,4 +48,3 @@ echo "\t] \n}" >> $DEPENDENCIES_GRADLE_FILE

# Cleanup
rm -rf turbo-android

10 changes: 6 additions & 4 deletions packages/turbo/scripts/build-turbo-ios.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
TURBO_IOS_REPO_PATH="https://github.com/hotwired/turbo-ios.git"
TURBO_IOS_VERSION=$1

shopt -s extglob

# First argument is the version tag
if [ -z "$TURBO_IOS_VERSION" ]
then
Expand All @@ -19,6 +17,10 @@ mkdir vendor
cd vendor
git clone --branch $TURBO_IOS_VERSION --depth 1 $TURBO_IOS_REPO_PATH

# Remove all files except Source directory
# Keep the Source folder and remove the rest
cd turbo-ios
rm -rf !(Source)
for file in *; do
if [ "$file" != "Source" ]; then
rm -rf $file
fi
done

0 comments on commit 314e7c1

Please sign in to comment.