Skip to content

Commit

Permalink
chore: RMET-3300 Use Native Libs via Pod/Maven (#6)
Browse files Browse the repository at this point in the history
* chore: pods working

* chore: update cap to next(v6)
  • Loading branch information
IT-MikeS authored Apr 9, 2024
1 parent 64993d0 commit d601cb5
Show file tree
Hide file tree
Showing 44 changed files with 206 additions and 7,267 deletions.
2 changes: 1 addition & 1 deletion example-app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
namespace "io.ionic.starter"
compileSdkVersion rootProject.ext.compileSdkVersion
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "io.ionic.starter"
minSdkVersion rootProject.ext.minSdkVersion
Expand Down
2 changes: 1 addition & 1 deletion example-app/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ android {
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-barcode-scanner')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-barcode-scanner')

}

Expand Down
4 changes: 2 additions & 2 deletions example-app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.google.gms:google-services:4.4.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
16 changes: 8 additions & 8 deletions example-app/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../../node_modules/.pnpm/@capacitor+android@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/android/capacitor')
project(':capacitor-android').projectDir = new File('../../node_modules/.pnpm/@capacitor+android@6.0.0-rc.2_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/android/capacitor')

include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app/android')
project(':capacitor-app').projectDir = new File('../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app/android')

include ':capacitor-barcode-scanner'
project(':capacitor-barcode-scanner').projectDir = new File('../../plugin/android')

include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../../node_modules/.pnpm/@capacitor+haptics@5.0.7_@capacitor+core@5.7.0/node_modules/@capacitor/haptics/android')
project(':capacitor-haptics').projectDir = new File('../../node_modules/.pnpm/@capacitor+haptics@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/haptics/android')

include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../../node_modules/.pnpm/@capacitor+keyboard@5.0.8_@capacitor+core@5.7.0/node_modules/@capacitor/keyboard/android')
project(':capacitor-keyboard').projectDir = new File('../../node_modules/.pnpm/@capacitor+keyboard@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/keyboard/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar/android')

include ':capacitor-barcode-scanner'
project(':capacitor-barcode-scanner').projectDir = new File('../../plugin/android')
project(':capacitor-status-bar').projectDir = new File('../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar/android')
Binary file modified example-app/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion example-app/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions example-app/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
12 changes: 6 additions & 6 deletions example-app/android/variables.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ext {
minSdkVersion = 26
minSdkVersion = 22
compileSdkVersion = 34
targetSdkVersion = 34
androidxActivityVersion = '1.7.0'
androidxActivityVersion = '1.8.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.10.0'
androidxFragmentVersion = '1.5.6'
coreSplashScreenVersion = '1.0.0'
androidxWebkitVersion = '1.6.1'
androidxCoreVersion = '1.12.0'
androidxFragmentVersion = '1.6.2'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.9.0'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
Expand Down
4 changes: 2 additions & 2 deletions example-app/ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
Base,
);
mainGroup = 504EC2FB1FED79650016851F;
packageReferences = (
);
productRefGroup = 504EC3051FED79650016851F /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -347,7 +349,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9YN2HU59K8;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -368,7 +369,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9YN2HU59K8;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions example-app/ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Uses the camera to scan barcodes</string>
</dict>
</plist>
14 changes: 7 additions & 7 deletions example-app/ios/App/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../../../node_modules/.pnpm/@capacitor+ios@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/ios/scripts/pods_helpers'
require_relative '../../../node_modules/.pnpm/@capacitor+ios@6.0.0-rc.2_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/ios/scripts/pods_helpers'

platform :ios, '13.0'
use_frameworks!
Expand All @@ -9,13 +9,13 @@ use_frameworks!
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
pod 'Capacitor', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
pod 'CapacitorApp', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app'
pod 'CapacitorHaptics', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics'
pod 'CapacitorKeyboard', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard'
pod 'CapacitorStatusBar', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar'
pod 'Capacitor', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios'
pod 'CapacitorApp', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/app'
pod 'CapacitorBarcodeScanner', :path => '../../../plugin'
pod 'CapacitorHaptics', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics'
pod 'CapacitorKeyboard', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard'
pod 'CapacitorStatusBar', :path => '../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar'
end

target 'App' do
Expand Down
61 changes: 34 additions & 27 deletions example-app/ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,52 +1,59 @@
PODS:
- Capacitor (5.7.0):
- Capacitor (6.0.0-rc.2):
- CapacitorCordova
- CapacitorApp (5.0.7):
- CapacitorApp (6.0.0-rc.1):
- Capacitor
- CapacitorBarcodeScanner (1.0.0-alpha.0):
- Capacitor
- CapacitorCordova (5.7.0)
- CapacitorHaptics (5.0.7):
- OSBarcodeLib (~> 1.0.0)
- CapacitorCordova (6.0.0-rc.2)
- CapacitorHaptics (6.0.0-rc.1):
- Capacitor
- CapacitorKeyboard (5.0.8):
- CapacitorKeyboard (6.0.0-rc.1):
- Capacitor
- CapacitorStatusBar (5.0.7):
- CapacitorStatusBar (6.0.0-rc.1):
- Capacitor
- OSBarcodeLib (1.0.0)

DEPENDENCIES:
- "Capacitor (from `../../../node_modules/.pnpm/@capacitor+ios@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../../node_modules/.pnpm/@capacitor+app@5.0.7_@capacitor+core@5.7.0/node_modules/@capacitor/app`)"
- "Capacitor (from `../../../node_modules/.pnpm/@capacitor+ios@6.0.0-rc.2_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../../node_modules/.pnpm/@capacitor+app@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/app`)"
- CapacitorBarcodeScanner (from `../../../plugin`)
- "CapacitorCordova (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios`)"
- "CapacitorHaptics (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics`)"
- "CapacitorKeyboard (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard`)"
- "CapacitorStatusBar (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar`)"
- "CapacitorCordova (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios`)"
- "CapacitorHaptics (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics`)"
- "CapacitorKeyboard (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard`)"
- "CapacitorStatusBar (from `../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar`)"

SPEC REPOS:
trunk:
- OSBarcodeLib

EXTERNAL SOURCES:
Capacitor:
:path: "../../../node_modules/.pnpm/@capacitor+ios@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/ios"
:path: "../../../node_modules/.pnpm/@capacitor+ios@6.0.0-rc.2_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/ios"
CapacitorApp:
:path: "../../../node_modules/.pnpm/@capacitor+app@5.0.7_@capacitor+core@5.7.0/node_modules/@capacitor/app"
:path: "../../../node_modules/.pnpm/@capacitor+app@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/app"
CapacitorBarcodeScanner:
:path: "../../../plugin"
CapacitorCordova:
:path: "../../../node_modules/.pnpm/@capacitor+ios@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/ios"
:path: "../../../node_modules/.pnpm/@capacitor+ios@6.0.0-rc.2_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/ios"
CapacitorHaptics:
:path: "../../../node_modules/.pnpm/@capacitor+haptics@5.0.7_@capacitor+core@5.7.0/node_modules/@capacitor/haptics"
:path: "../../../node_modules/.pnpm/@capacitor+haptics@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/haptics"
CapacitorKeyboard:
:path: "../../../node_modules/.pnpm/@capacitor+keyboard@5.0.8_@capacitor+core@5.7.0/node_modules/@capacitor/keyboard"
:path: "../../../node_modules/.pnpm/@capacitor+keyboard@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/keyboard"
CapacitorStatusBar:
:path: "../../../node_modules/.pnpm/@capacitor+status-bar@5.0.7_@capacitor+core@5.7.0/node_modules/@capacitor/status-bar"
:path: "../../../node_modules/.pnpm/@capacitor+status-bar@6.0.0-rc.1_@capacitor+core@6.0.0-rc.2/node_modules/@capacitor/status-bar"

SPEC CHECKSUMS:
Capacitor: fc155ee2ee45a2093d716f13cf5aa5a865e2d85a
CapacitorApp: 17fecd0e6cb23feafac7eb0939417389038b0979
CapacitorBarcodeScanner: e278ac16d24a971dc54ff5d206186f3df4433100
CapacitorCordova: e825fce1a2e14e4b5730641c7e098dccf74397b7
CapacitorHaptics: 7c7c206f0c96a628fed073830c96d28c4b2e772e
CapacitorKeyboard: aec619a578235c6ce279075009a2689c2cf5c42c
CapacitorStatusBar: f390fbb49b82ffb754ea4b3cf71dc8b048baf3e7
Capacitor: 616838064c270088c3c51e0bb2f57259c09f3d55
CapacitorApp: 649eca1980ddb28d43177bc78b252123e243b848
CapacitorBarcodeScanner: 2c52ec265dcf61c15f471f61bbbbdfd85269112d
CapacitorCordova: 62056f853503fb402c3bd9ea9b93b30f23d1c1ce
CapacitorHaptics: b004f0eb5b1cbef124889ccf745679f3aa9568ef
CapacitorKeyboard: 683563ad6b13c1a46bfc710d49b4621570feef48
CapacitorStatusBar: 31febfff4331f2e800847abdac79d64f04eb4206
OSBarcodeLib: e5075922166a0140d7e22218efe904a4b359f056

PODFILE CHECKSUM: 60746a6f3cc16d31665ae588420b9f720d04ec56
PODFILE CHECKSUM: e4140fc02500ab3a454d73af10000b75805fc486

COCOAPODS: 1.12.1
COCOAPODS: 1.15.2
20 changes: 10 additions & 10 deletions example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
"lint": "eslint"
},
"dependencies": {
"@capacitor/android": "^5.7.0",
"@capacitor/app": "5.0.7",
"@capacitor/core": "^5.7.0",
"@capacitor/haptics": "5.0.7",
"@capacitor/ios": "^5.7.0",
"@capacitor/keyboard": "5.0.8",
"@capacitor/status-bar": "5.0.7",
"@capacitor/android": "next",
"@capacitor/app": "next",
"@capacitor/barcode-scanner": "workspace:*",
"@capacitor/core": "next",
"@capacitor/haptics": "next",
"@capacitor/ios": "next",
"@capacitor/keyboard": "next",
"@capacitor/status-bar": "next",
"@ionic/react": "^7.0.0",
"@ionic/react-router": "^7.0.0",
"@types/react-router": "^5.1.20",
Expand All @@ -27,11 +28,10 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"@capacitor/barcode-scanner": "workspace:*"
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@capacitor/cli": "5.6.0",
"@capacitor/cli": "next",
"@testing-library/dom": ">=7.21.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
Expand Down
2 changes: 1 addition & 1 deletion plugin/CapacitorBarcodeScanner.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '13.0'
s.dependency 'Capacitor'
s.vendored_frameworks = 'ios/VendorFrameworks/OSBarcodeLib.xcframework'
s.dependency 'OSBarcodeLib', '~> 1.0.0'
s.swift_version = '5.1'
end
26 changes: 26 additions & 0 deletions plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ npm install @capacitor/barcode-scanner
npx cap sync
```

#### Android

You will need to modify the `allprojects > repositories` section in your `android/build.gradle` file to include the Outsystems repository. Your `android/build.gradle` file should look similar to this after adding the repository.

```gradle
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://pkgs.dev.azure.com/OutSystemsRD/9e79bc5b-69b2-4476-9ca5-d67594972a52/_packaging/PublicArtifactRepository/maven/v1'
name 'Azure'
credentials {
username = "optional"
password = ""
}
content {
includeGroup "com.github.outsystems"
}
}
}
}
```

---

## API

<docgen-index>
Expand Down
Loading

0 comments on commit d601cb5

Please sign in to comment.