diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index df61031..d285ec0 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -41,7 +41,7 @@ jobs: - name: Extract project name id: extract run: | - PROJECT_NAME=$(echo ${{ github.ref_name }} | rev | cut -d '-' -f 2- | rev) + PROJECT_NAME=$(dart cli/main.dart project_name ${{ github.ref_name }}) echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV shell: bash diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 1ccad47..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,4 +0,0 @@ -[workspace] -members = [ - "packages/*" -] \ No newline at end of file diff --git a/brick/__brick__/{{name.snakeCase()}}/android/build.gradle b/brick/__brick__/{{name.snakeCase()}}/android/build.gradle index 881e1ee..87be3b7 100644 --- a/brick/__brick__/{{name.snakeCase()}}/android/build.gradle +++ b/brick/__brick__/{{name.snakeCase()}}/android/build.gradle @@ -31,7 +31,7 @@ android { // Bumping the plugin ndkVersion requires all clients of this plugin to bump // the version in their app and to download a newer version of the NDK. - ndkVersion "21.4.7075529" + ndkVersion "25.1.8937393" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/brick/__brick__/{{name.snakeCase()}}/ios/{{name.snakeCase()}}.podspec b/brick/__brick__/{{name.snakeCase()}}/ios/{{name.snakeCase()}}.podspec index 6c851a0..90c5f4f 100644 --- a/brick/__brick__/{{name.snakeCase()}}/ios/{{name.snakeCase()}}.podspec +++ b/brick/__brick__/{{name.snakeCase()}}/ios/{{name.snakeCase()}}.podspec @@ -2,7 +2,7 @@ release_tag_name = '{{name.snakeCase()}}-v0.0.0' # generated; do not edit # We cannot distribute the XCFramework alongside the library directly, # so we have to fetch the correct version here. -framework_name = '{{name.pascalCase()}}-ios.xcframework' +framework_name = '{{name.snakeCase()}}-ios.xcframework' remote_zip_name = "#{framework_name}.zip" url = "https://github.com/{{github_user}}/{{repo_name}}/releases/download/#{release_tag_name}/#{remote_zip_name}" local_zip_name = "#{release_tag_name}.zip" diff --git a/brick/__brick__/{{name.snakeCase()}}/macos/{{name.snakeCase()}}.podspec b/brick/__brick__/{{name.snakeCase()}}/macos/{{name.snakeCase()}}.podspec index 3644167..e2bbd61 100644 --- a/brick/__brick__/{{name.snakeCase()}}/macos/{{name.snakeCase()}}.podspec +++ b/brick/__brick__/{{name.snakeCase()}}/macos/{{name.snakeCase()}}.podspec @@ -2,7 +2,7 @@ release_tag_name = '{{name.snakeCase()}}-v0.0.0' # generated; do not edit # We cannot distribute the XCFramework alongside the library directly, # so we have to fetch the correct version here. -framework_name = '{{name.pascalCase()}}-macos.xcframework' +framework_name = '{{name.snakeCase()}}-macos.xcframework' remote_zip_name = "#{framework_name}.zip" url = "https://github.com/{{github_user}}/{{repo_name}}/releases/download/#{release_tag_name}/#{remote_zip_name}" local_zip_name = "#{release_tag_name}.zip" diff --git a/cli/commands/android.dart b/cli/commands/android.dart index 8ab96bf..6cac4bf 100644 --- a/cli/commands/android.dart +++ b/cli/commands/android.dart @@ -34,17 +34,20 @@ class AndroidBuildCommand extends Command with BuildConfig { await ensureBuildDirectoryExists(project); - final shell = Shell(workingDirectory: buildDir); + final shell = Shell(workingDirectory: join(projectDir, "native")); await shell.run(""" cargo install cargo-ndk rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android """); - final jniDir = join(cwd, "jniLibs"); + final jniDir = Directory(join(buildDir, "jniLibs")); + + await jniDir.create(recursive: true); + await shell.run(""" - cargo ndk -o ${shellArgument(jniDir)} \\ - --manifest-path ${shellArgument(join(projectDir, "Cargo.toml"))} \\ + cargo ndk -o ${jniDir.path} \\ + --manifest-path ${join(projectDir, "Cargo.toml")} \\ -t armeabi-v7a \\ -t arm64-v8a \\ -t x86 \\ @@ -52,8 +55,10 @@ class AndroidBuildCommand extends Command with BuildConfig { build --release """); - await shell.cd(jniDir).run("tar -czvf ../android.tar.gz *"); + await shell + .cd(jniDir.path) + .run("tar -czvf ../android.tar.gz armeabi-v7a arm64-v8a x86 x86_64"); - await Directory(jniDir).delete(recursive: true); + await jniDir.delete(recursive: true); } } diff --git a/cli/commands/project_name.dart b/cli/commands/project_name.dart new file mode 100644 index 0000000..30147ed --- /dev/null +++ b/cli/commands/project_name.dart @@ -0,0 +1,26 @@ +import 'dart:io'; + +import 'package:args/command_runner.dart'; + +class ProjectNameExtractCommand extends Command { + @override + String get name => "project_name"; + @override + String get description => + "Extract the project name from the pubspec.yaml file"; + + ProjectNameExtractCommand() { + argParser.addOption("path", abbr: "p", mandatory: true); + } + + @override + run() async { + final tagName = argResults?.arguments.firstOrNull; + if (tagName == null || tagName.isEmpty) { + stderr.writeln("No tag name provided"); + return; + } + + stdout.writeln(tagName.split("-v").first.trim()); + } +} diff --git a/cli/main.dart b/cli/main.dart index f4f8373..2abc54c 100644 --- a/cli/main.dart +++ b/cli/main.dart @@ -4,6 +4,7 @@ import 'commands/android.dart'; import 'commands/ios.dart'; import 'commands/linux.dart'; import 'commands/macos.dart'; +import 'commands/project_name.dart'; import 'commands/version.dart'; import 'commands/windows.dart'; @@ -17,5 +18,6 @@ void main(List args) { ..addCommand(WindowsBuildCommand()) ..addCommand(LinuxBuildCommand()) ..addCommand(VersionCommand()) + ..addCommand(ProjectNameExtractCommand()) ..run(args); } diff --git a/packages/metadata_god/android/build.gradle b/packages/metadata_god/android/build.gradle index c33d954..bbc1556 100644 --- a/packages/metadata_god/android/build.gradle +++ b/packages/metadata_god/android/build.gradle @@ -31,7 +31,7 @@ android { // Bumping the plugin ndkVersion requires all clients of this plugin to bump // the version in their app and to download a newer version of the NDK. - ndkVersion "21.4.7075529" + ndkVersion "25.1.8937393" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/packages/metadata_god/ios/metadata_god.podspec b/packages/metadata_god/ios/metadata_god.podspec index f34a825..d2ce891 100644 --- a/packages/metadata_god/ios/metadata_god.podspec +++ b/packages/metadata_god/ios/metadata_god.podspec @@ -2,7 +2,7 @@ release_tag_name = 'metadata_god-v0.5.2' # generated; do not edit # We cannot distribute the XCFramework alongside the library directly, # so we have to fetch the correct version here. -framework_name = 'MetadataGod.xcframework' +framework_name = 'metadata_god-ios.xcframework' remote_zip_name = "#{framework_name}.zip" url = "https://github.com/KRTirtho/frb_plugins/releases/download/#{release_tag_name}/#{remote_zip_name}" local_zip_name = "#{release_tag_name}.zip" diff --git a/packages/metadata_god/macos/metadata_god.podspec b/packages/metadata_god/macos/metadata_god.podspec index f34a825..c1fccb5 100644 --- a/packages/metadata_god/macos/metadata_god.podspec +++ b/packages/metadata_god/macos/metadata_god.podspec @@ -2,7 +2,7 @@ release_tag_name = 'metadata_god-v0.5.2' # generated; do not edit # We cannot distribute the XCFramework alongside the library directly, # so we have to fetch the correct version here. -framework_name = 'MetadataGod.xcframework' +framework_name = 'metadata_god-macos.xcframework' remote_zip_name = "#{framework_name}.zip" url = "https://github.com/KRTirtho/frb_plugins/releases/download/#{release_tag_name}/#{remote_zip_name}" local_zip_name = "#{release_tag_name}.zip"