Skip to content

Commit

Permalink
gradle & podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricGuillemet committed Sep 8, 2023
1 parent c92e5be commit 28b52a4
Show file tree
Hide file tree
Showing 4 changed files with 265 additions and 120 deletions.
234 changes: 116 additions & 118 deletions .github/workflows/publish_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,59 @@ on:
default: preview

jobs:
# build-android-ios-064:
# uses: ./.github/workflows/ios_android.yml
# with:
# react-native-version: '0.64'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-android-ios-065:
# uses: ./.github/workflows/ios_android.yml
# with:
# react-native-version: '0.65'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-android-ios-069:
# uses: ./.github/workflows/ios_android.yml
# with:
# react-native-version: '0.69'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-android-ios-070:
# uses: ./.github/workflows/ios_android.yml
# with:
# react-native-version: '0.70'
# release-version: ${{ github.event.inputs.release_version }}
build-android-ios-064:
uses: ./.github/workflows/ios_android.yml
with:
react-native-version: '0.64'
release-version: ${{ github.event.inputs.release_version }}

build-android-ios-065:
uses: ./.github/workflows/ios_android.yml
with:
react-native-version: '0.65'
release-version: ${{ github.event.inputs.release_version }}

build-android-ios-069:
uses: ./.github/workflows/ios_android.yml
with:
react-native-version: '0.69'
release-version: ${{ github.event.inputs.release_version }}

build-android-ios-070:
uses: ./.github/workflows/ios_android.yml
with:
react-native-version: '0.70'
release-version: ${{ github.event.inputs.release_version }}

build-android-ios-071:
uses: ./.github/workflows/ios_android.yml
with:
react-native-version: '0.71'
release-version: ${{ github.event.inputs.release_version }}

# build-windows-064:
# uses: ./.github/workflows/windows.yml
# with:
# react-native-version: '0.64'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-windows-065:
# uses: ./.github/workflows/windows.yml
# with:
# react-native-version: '0.65'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-windows-069:
# uses: ./.github/workflows/windows.yml
# with:
# react-native-version: '0.69'
# release-version: ${{ github.event.inputs.release_version }}
#
# build-windows-070:
# uses: ./.github/workflows/windows.yml
# with:
# react-native-version: '0.70'
# release-version: ${{ github.event.inputs.release_version }}
build-windows-064:
uses: ./.github/workflows/windows.yml
with:
react-native-version: '0.64'
release-version: ${{ github.event.inputs.release_version }}

build-windows-065:
uses: ./.github/workflows/windows.yml
with:
react-native-version: '0.65'
release-version: ${{ github.event.inputs.release_version }}

build-windows-069:
uses: ./.github/workflows/windows.yml
with:
react-native-version: '0.69'
release-version: ${{ github.event.inputs.release_version }}

build-windows-070:
uses: ./.github/workflows/windows.yml
with:
react-native-version: '0.70'
release-version: ${{ github.event.inputs.release_version }}

build-windows-071:
uses: ./.github/workflows/windows.yml
Expand All @@ -93,88 +93,87 @@ jobs:
with:
name: 'Assembled'
path: Package/Assembled
# - name: Download Assembled-iOSAndroid 0.64 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-iOSAndroid0.64'
# path: Package/Assembled-iOSAndroid0.64
# - name: Download Assembled-iOSAndroid 0.65 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-iOSAndroid0.65'
# path: Package/Assembled-iOSAndroid0.65
# - name: Download Assembled-iOSAndroid 0.69 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-iOSAndroid0.69'
# path: Package/Assembled-iOSAndroid0.69
# - name: Download Assembled-iOSAndroid 0.70 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-iOSAndroid0.70'
# path: Package/Assembled-iOSAndroid0.70
- name: Download Assembled-iOSAndroid 0.64 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-iOSAndroid0.64'
path: Package/Assembled-iOSAndroid0.64
- name: Download Assembled-iOSAndroid 0.65 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-iOSAndroid0.65'
path: Package/Assembled-iOSAndroid0.65
- name: Download Assembled-iOSAndroid 0.69 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-iOSAndroid0.69'
path: Package/Assembled-iOSAndroid0.69
- name: Download Assembled-iOSAndroid 0.70 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-iOSAndroid0.70'
path: Package/Assembled-iOSAndroid0.70
- name: Download Assembled-iOSAndroid 0.71 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-iOSAndroid0.71'
path: Package/Assembled-iOSAndroid0.71
# - name: Download Assembled-Windows 0.64 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-Windows0.64'
# path: Package/Assembled-Windows0.64
# - name: Download Assembled-Windows 0.65 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-Windows0.65'
# path: Package/Assembled-Windows0.65
# - name: Download Assembled-Windows 0.69 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-Windows0.69'
# path: Package/Assembled-Windows0.69
# - name: Download Assembled-Windows 0.70 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-Windows0.70'
# path: Package/Assembled-Windows0.70
- name: Download Assembled-Windows 0.64 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-Windows0.64'
path: Package/Assembled-Windows0.64
- name: Download Assembled-Windows 0.65 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-Windows0.65'
path: Package/Assembled-Windows0.65
- name: Download Assembled-Windows 0.69 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-Windows0.69'
path: Package/Assembled-Windows0.69
- name: Download Assembled-Windows 0.70 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-Windows0.70'
path: Package/Assembled-Windows0.70
- name: Download Assembled-Windows 0.71 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-Windows0.71'
path: Package/Assembled-Windows0.71

#BaseKit
# - name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-iOSAndroid0.69'
# path: Package/Assembled-BaseKit-iOSAndroid0.69
# - name: Download Assembled-BaseKit-iOSAndroid 0.70 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-iOSAndroid0.70'
# path: Package/Assembled-BaseKit-iOSAndroid0.70
# - name: Download Assembled-BaseKit-iOSAndroid 0.71 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-iOSAndroid0.71'
# path: Package/Assembled-BaseKit-iOSAndroid0.71
# - name: Download Assembled-BaseKit-Windows 0.69 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-Windows0.69'
# path: Package/Assembled-BaseKit-Windows0.69
# - name: Download Assembled-BaseKit-Windows 0.70 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-Windows0.70'
# path: Package/Assembled-BaseKit-Windows0.70
# - name: Download Assembled-BaseKit-Windows 0.71 Folder
# uses: actions/download-artifact@v2
# with:
# name: 'Assembled-BaseKit-Windows0.71'
# path: Package/Assembled-BaseKit-Windows0.71
- name: Download Assembled-BaseKit-iOSAndroid 0.69 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-iOSAndroid0.69'
path: Package/Assembled-BaseKit-iOSAndroid0.69
- name: Download Assembled-BaseKit-iOSAndroid 0.70 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-iOSAndroid0.70'
path: Package/Assembled-BaseKit-iOSAndroid0.70
- name: Download Assembled-BaseKit-iOSAndroid 0.71 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-iOSAndroid0.71'
path: Package/Assembled-BaseKit-iOSAndroid0.71
- name: Download Assembled-BaseKit-Windows 0.69 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-Windows0.69'
path: Package/Assembled-BaseKit-Windows0.69
- name: Download Assembled-BaseKit-Windows 0.70 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-Windows0.70'
path: Package/Assembled-BaseKit-Windows0.70
- name: Download Assembled-BaseKit-Windows 0.71 Folder
uses: actions/download-artifact@v2
with:
name: 'Assembled-BaseKit-Windows0.71'
path: Package/Assembled-BaseKit-Windows0.71

- name: Display structure of downloaded Assembled and Assembled-Windows folders
run: ls -R
Expand Down Expand Up @@ -265,7 +264,6 @@ jobs:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
#BaseKit

# - name: Version & Publish Package @babylonjs/react-native-basekit-iosandroid-0-69
# run: |
# npm version --no-git-tag-version ${{ github.event.inputs.release_version }}
Expand Down
118 changes: 118 additions & 0 deletions Package/BaseKit/Android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// android/build.gradle

// based on:
//
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
// original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
//
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
// original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle

def DEFAULT_COMPILE_SDK_VERSION = 30
def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2'
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 30

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

def reactProperties = new Properties()
file("$projectDir/../../../react-native/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
def REACT_VERSION = reactProperties.getProperty("VERSION_NAME").split("\\.")[1].toInteger()

apply plugin: 'com.android.library'

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
if (project == rootProject) {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
}
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
prefab true
}

}

// The full/real version of libturbomodulejsijni.so will be built and included in apps using React Native 0.64 or newer,
// so exclude Babylon React Native's minimal version of these libs in this case.
if (REACT_VERSION >= 64) {
android.packagingOptions.excludes += 'lib/armeabi-v7a/libturbomodulejsijni.so'
android.packagingOptions.excludes += 'lib/arm64-v8a/libturbomodulejsijni.so'
android.packagingOptions.excludes += 'lib/x86/libturbomodulejsijni.so'
}

repositories {
google()
mavenCentral()
}

dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
}

def configureReactNativePom(def pom) {
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)

pom.project {
name packageJson.title
artifactId packageJson.name
version = packageJson.version
group = "com.babylonreactnative"
description packageJson.description
url packageJson.repository.baseUrl

licenses {
license {
name packageJson.license
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
distribution 'repo'
}
}

developers {
developer {
id packageJson.author.username
name packageJson.author.name
}
}
}
}

task validateSdk {
def minSdkVersion = safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
if (minSdkVersion < DEFAULT_MIN_SDK_VERSION) {
throw new GradleException("minSdkVersion must be at least ${DEFAULT_MIN_SDK_VERSION} but is currently ${minSdkVersion}")
}
}
Loading

0 comments on commit 28b52a4

Please sign in to comment.