Skip to content

Commit

Permalink
Android lib from dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
chanonly123 committed Feb 9, 2025
1 parent 657e1da commit 2a10b46
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 26 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## generated coppied binaries
flutter_app/android/juce_lib/juce_lib.aar
flutter_app/ios/Runner/juce_lib.xcframework/**

## User settings
xcuserdata/

Expand Down
17 changes: 10 additions & 7 deletions android_juce_lib_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ else
echo "✅ build output found [$libOutFile]"
fi

if [ -d "$flutter_app/android/$libname" ]; then
cp -r $libOutFile "$flutter_app/android/juce_lib/$libname.aar" &&
echo "✅ Copy to [$flutter_app] project Success ✅"
else
echo "🔴 [$flutter_app/android/$libname] not found ✅"
exit 1
fi
cd "$root_dir"

rm -rf \
"dist/$libname.aar"

cp -r \
"$libOutFile" \
"dist/$libname.aar"

echo "✅ Copy arr to 'dist' success ✅"
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply plugin: 'maven-publish'

group = 'com.github.chanonly123'

configurations.maybeCreate("default")
artifacts.add("default", file('dist/juce_lib.aar'))
Binary file added dist/juce_lib.aar
Binary file not shown.
2 changes: 0 additions & 2 deletions flutter_app/android/juce_lib/build.gradle

This file was deleted.

5 changes: 3 additions & 2 deletions flutter_app/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pluginManagement {

include(":juce_lib")

def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
Expand All @@ -10,6 +8,9 @@ pluginManagement {
return flutterSdkPath
}()

include(':juce_lib')
project(':juce_lib').projectDir = new File('../../')

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
Expand Down
12 changes: 1 addition & 11 deletions ios_juce_lib_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,4 @@ cp -r \
"$libname/Builds/iOS/build/${libname}.xcframework" \
"dist/$libname.xcframework"

# copy framework to flutter_app project

if [ -d "$flutter_app/ios/Runner/" ]; then
rm -rf "$flutter_app/ios/Runner/$libname.xcframework"

cp -r \
"$libname/Builds/iOS/build/$libname.xcframework" \
"$flutter_app/ios/Runner/$libname.xcframework" &&

echo "✅ Copy to project Success ✅"
fi
echo "✅ Copy framework to 'dist' success ✅"

0 comments on commit 2a10b46

Please sign in to comment.