Skip to content

Commit

Permalink
Capacitor migration (#1743)
Browse files Browse the repository at this point in the history
* iOS: modify route creates additional point #1726 - remove webview plugin

* #1726 - Fix iOs build (I hope), fix lottie poi animation

* #1726 - Fix iOS build plugin name problem, fix tests

* Use the plugin from the oroginal author and not from the fork

* #1762 - remove incorrect unused import

* Update to latest webview fix

* #1698 - Migrate to Capacitor - remove plugins and add capacitor

* #1698 - Migrate to Capacitor - Added purchase plugin

* #1698 - Migrate to Capacitor - Added sqlite-ext plugin

* #1698 - Migrate to Capacitor - add cordova-plugin-file

* #1698 - Migrate to Capacitor - Added cordova-plugin-filetransfer

* #1698 - Migrate to Capacitor - Fixed file plugin and added social sharing plugin

* #1698 - Migrate to Capacitor - Add background geolocation plugin

* #1698 - Migrate to Capacitor - update CI code

* #1698 - Migrate to Capacitor - Add app and device plugins, fix CI

* #1698 - Migrate to Capacitor - Add screen brightness and keep awake

* #1698 - Migrate to Capacitor - Added capacitor camera plugin

* #1698 - Migrate to Capacitor - Fix camera compilation error

* #1698 - Migrate to Capacitor - Reduce cordova name in app, fix camera plugin usage

* #1698 - Migrate to Capacitor - Fix export plist options to include provisioning profile

* #1698 - Migrate to Capacitor - Fix icons, remove cordova config

* #1698 - Migrate to Capacitor - Fix Add missing icons

* #1698 - Migrate to Capacitor - Fix icons

* #1698 - Migrate to Capacitor - improve url handling

* #1698 - Migrate to Capacitor - added ouath plugin

* #1698 - Migrate to Capacitor - added device orienation, remove is cordova, removed resume events

* #1698 - Migrate to Capacitor - fix ios crash due to missing preferences

* #1698 - Migrate to Capacitor - Fix iOS crash due to missing preference

* #1698 - Migrate to Capacitor - Added vibration, removed some TODOs

* #1698 - Migrate to Capacitor - replace capacitor file system with cordova due to large files, add in comment the migration to capasitor sqlite

* #1698 - Migrate to Capacitor - missing files in previous commit - remove capacitor filesystem

* #1698 - Migrate to Capacitor - Fix tests

* #1698 - Migrate to Capacitor - replace cordova sqlite with capacitor's

* #1698 - Migrate to Capacitor - Fix ios compilation, fix cache folder in android

* #1698 - Migrate to Capacitor - Fix sqlite-community with patch-package

* #1698 - Migrate to Capacitor - upgrade to angular 14

* #1698 - Migrate to Capacitor - Upgrade to material 13

* #1698 - Migrate to Capacitor - update flex layout

* #1698 - Migrate to Capacitor - fix lint, update material to 14

* #1698 - Migrate to Capacitor - update other dependencies

* #1698 - Migrate to Capacitor - remove more todos

* #1698 - Migrate to Capacitor - Hide statusbar instaed of using a plugin

* #1698 - Migrate to Capacitor - update ios version using patch package

* #1698 - Migrate to Capacitor - update geolocation plugin version to 2.0.5

* #1698 - Migrate to Capacitor - change ios default version

* #1698 - Migrate to Capacitor - Fix scss encoding and split it back

* #1698 - Migrate to Capacitor - Fix pois sidebar and turn them into buttons

* #1698 - Migrate to Capacitor - update eslint version

* #1698 - Migrate to Capacitor - update capacitor to version 4.0.1

* #1698 - Migrate to Capacitor - update jdk to 11

* #1698 - Migrate to Capacitor - fix android icon

* #1698 - Migrate to Capacitor - update more dependecies

* #1698 - Migrate to Capacitor - fix icon and upgrade geolocation plugin to version 2.0.6

* #1698 - Migrate to Capacitor - Fix reading a file issue due to a bug in the cordova plugin

* #1698 - Migrate to Capacitor - Fix zoom text size

* #1698 - Migrate to Capacitor - fix merge from main

* #1698 - Migrate to Capacitor - Move out of @ionic-native into @awesome-cordova-plugins

* #1698 - Migrate to Capacitor - Fix ios cache folder, small UI improvement in progess dialog

* #1698 - Migrate to Capacitor -  added --prod to sync

* #1698 - Migrate to Capacitor - Fix cap sync and remove the set-capacitor-version package

* #1698 - Migrate to Capacitor - remove set-capacitor-version

* #1698 - Migrate to Capacitor - Add CI print for the files that have changed

* #1698 - Migrate to Capacitor - Fix CI version issues

* #1698 - Migrate to Capacitor - Fix ios version change

* #1698 - Migrate to Capacitor - update d3 to latest version and remove angular wrapper

* #1698 - Migrate to Capacitor - See if android build tools are not needed?

* #1698 - Migrate to Capacitor - remove unneeded code from android ci script

* #1698 - Migrate to Capacitor - Added database migration code

* #1698 - Migrate to Capacitor - Fix database name issue

* #1698 - Migrate to Capacitor - Added native audio to support sound notifications

* #1698 - Migrate to Capacitor - Fix file not found exception

* #1698 - Migrate to Capacitor - Fix android database file location

* #1698 - Migrate to Capacitor - remove commonjs warnings

* #1698 - Migrate to Capacitor - add ios scheme to preserve local storage

* #1698 - Migrate to Capacitor - code review changes
  • Loading branch information
HarelM authored Aug 10, 2022
1 parent 1dee9c5 commit f5a36c0
Show file tree
Hide file tree
Showing 204 changed files with 17,192 additions and 31,483 deletions.
13 changes: 9 additions & 4 deletions IsraelHiking.Web/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
96 changes: 96 additions & 0 deletions IsraelHiking.Web/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore

# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Android Profiling
*.hprof

# Cordova plugins for Capacitor
capacitor-cordova-android-plugins

# Copied web assets
app/src/main/assets/public
2 changes: 2 additions & 0 deletions IsraelHiking.Web/android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/*
!/build/.npmkeep
56 changes: 56 additions & 0 deletions IsraelHiking.Web/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
packagingOptions {
exclude 'build-data.properties'
}
defaultConfig {
applicationId "il.org.osm.israelhiking"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 91300
versionName "9.13.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}

dependencies {
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}

apply from: 'capacitor.build.gradle'

try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
32 changes: 32 additions & 0 deletions IsraelHiking.Web/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-keep-awake')
implementation project(':capacitor-community-native-audio')
implementation project(':capacitor-community-screen-brightness')
implementation project(':capacitor-community-sqlite')
implementation project(':capacitor-app')
implementation project(':capacitor-camera')
implementation project(':capacitor-device')
implementation project(':capacitor-text-zoom')
implementation "com.google.android.gms:play-services-location:11+"
implementation "androidx.core:core:1.1.0"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.webkit:webkit:1.4.0"
implementation "androidx.browser:browser:1.3.0"
implementation "com.android.billingclient:billing:4.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
}
apply from: "../../node_modules/cordova-background-geolocation-plugin/android/dependencies.gradle"

if (hasProperty('postBuildExtras')) {
postBuildExtras()
}
21 changes: 21 additions & 0 deletions IsraelHiking.Web/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.getcapacitor.myapp;

import static org.junit.Assert.*;

import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {

@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

assertEquals("com.getcapacitor.app", appContext.getPackageName());
}
}
Loading

0 comments on commit f5a36c0

Please sign in to comment.