Skip to content

Commit

Permalink
Report all things from main
Browse files Browse the repository at this point in the history
sdk path fix etc...
  • Loading branch information
e-marchand committed Aug 2, 2023
1 parent 7bdd799 commit d3da59c
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 320 deletions.
27 changes: 23 additions & 4 deletions Project/Sources/Classes/FEATURES.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -319,19 +319,21 @@ Function update()

End if

This:C1470._checkMobileAppServer()

If (Feature.with("androidPushNotifications"))

This:C1470.certificateGroup.show(Form:C1466.server.pushNotification & PROJECT.$ios)
This:C1470.certificateGroup.show(Bool:C1537(Form:C1466.server.pushNotification) & PROJECT.$ios)
This:C1470.certificateGroup.enable(Is macOS:C1572)
This:C1470.certificate.picker.browse:=Is macOS:C1572
This:C1470.certificate.touch()

This:C1470.configureFileGroup.show(Form:C1466.server.pushNotification & PROJECT.$android)
This:C1470.configureFileGroup.show(Bool:C1537(Form:C1466.server.pushNotification) & PROJECT.$android)
This:C1470.configureFile.touch()

Else

This:C1470.certificateGroup.show(Form:C1466.server.pushNotification)
This:C1470.certificateGroup.show(Bool:C1537(Form:C1466.server.pushNotification))
This:C1470.pushNotification.enable(Is macOS:C1572 & PROJECT.$ios)
This:C1470.certificateGroup.enable(Is macOS:C1572 & PROJECT.$ios)
This:C1470.certificate.picker.browse:=(Is macOS:C1572 & PROJECT.$ios)
Expand Down Expand Up @@ -589,4 +591,21 @@ Function configureFileCallback($file : 4D:C1709.File)
Function resetGoogleCertificat()

This:C1470.configureFile.picker.path:=String:C10(Form:C1466.server.configurationFile)
This:C1470.configureFile.picker:=This:C1470.configureFile.picker
This:C1470.configureFile.picker:=This:C1470.configureFile.picker


Function _checkMobileAppServer()
var $hasFeatures : Boolean
$hasFeatures:=Bool:C1537(Form:C1466.server.authentication.email) || Bool:C1537(Form:C1466.server.pushNotification) || Bool:C1537(Form:C1466.deepLinking.enabled)
var $message : Object
$message:=New object:C1471("message"; ""; "type"; "message")

If ($hasFeatures)
Database:=Database || cs:C1710.database.new()
If (Not:C34(Database.isComponentAvailable("4D Mobile App Server")))
$message.message:="💡 You could install 4d component https://github.com/4d/4D-Mobile-App-Server"
$message.url:="https://github.com/4d/4D-Mobile-App-Server"
End if
End if

UI.callMeBack("footer"; $message)
6 changes: 4 additions & 2 deletions Project/Sources/Classes/androidprojectgenerator.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -2552,12 +2552,14 @@ Function prepareSdk
If ($cacheSdkAndroid.exists)

$archive:=ZIP Read archive:C1637($cacheSdkAndroid)
$unzipDest:=This:C1470.path.cacheSdkAndroidUnzipped()

$unzipDest:=$archive.root.copyTo(This:C1470.path.cacheSdkAndroid().parent; fk overwrite:K87:5) // CLEAN: use cacheSdkAndroidUnzipped? without creating "sdk"?
$archive.root.files().combine($archive.root.folders()).map(Formula:C1597($1.value.copyTo($unzipDest)))

If ($unzipDest.exists)

$0.success:=True:C214
$0.success:=($unzipDest.files().length>0) || ($unzipDest.folders().length>0)
// XXX maybe delete empty folder to avoid miss integration

Else

Expand Down
1 change: 1 addition & 0 deletions Project/Sources/Classes/lep.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ Function launch($command; $arguments : Variant) : cs:C1710.lep
If (This:C1470.success)

This:C1470.pid:=$pid
This:C1470.errorStream:=This:C1470._cleanupStream($errorStream)

Case of

Expand Down
23 changes: 19 additions & 4 deletions Project/Sources/Classes/path.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,14 @@ Function preferences($fileName : Text) : Object
return This:C1470.target

//MARK:-INTERNAL

Function isSdkAppleExists() : Boolean

return This:C1470.cacheSdkAppleUnzipped().exists || This:C1470.sdkApple().exists/*will be unzipped*/

Function cacheSdkApple() : 4D:C1709.File

return This:C1470.cacheSdkVersion().folder("iOS").file("sdk.zip")

/*========================================================*/
Function cacheSdkAppleManifest() : 4D:C1709.File

Expand Down Expand Up @@ -248,10 +252,15 @@ Function sdk() : 4D:C1709.Folder

/*========================================================*/
Function sdkApple() : 4D:C1709.File // ios zip sdk
This:C1470.target:=This:C1470.hostSDK().file("ios.zip") // could be placed in client base
If (This:C1470.target.exists)
This:C1470.exists:=True:C214
return This:C1470.target
End if

This:C1470.target:=This:C1470.sdk().file("ios.zip") // if embedded it re-become the one used
If (This:C1470.exists)
This:C1470.exists:=This:C1470.target.exists
If (This:C1470.target.exists)
This:C1470.exists:=True:C214
return This:C1470.target
End if

Expand Down Expand Up @@ -288,9 +297,15 @@ Function isSDKAppleEmbedded() : Boolean

/*========================================================*/
Function sdkAndroid() : 4D:C1709.File // android zip sdk
This:C1470.target:=This:C1470.hostSDK().file("android.zip") // could be placed in client base
If (This:C1470.target.exists)
This:C1470.exists:=True:C214
return This:C1470.target
End if

This:C1470.target:=This:C1470.sdk().file("android.zip") // if embedded it become the one used
If (This:C1470.target.exists)
This:C1470.exists:=This:C1470.target.exists
This:C1470.exists:=True:C214
return This:C1470.target
End if

Expand Down
6 changes: 5 additions & 1 deletion Project/Sources/Forms/FOOTER/form.4DForm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"windowMaxWidth": 32767,
"windowMaxHeight": 32767,
"events": [
"onDoubleClick",
"onBoundVariableChange"
],
"windowTitle": "window title",
Expand Down Expand Up @@ -55,7 +56,10 @@
"sizingX": "grow",
"dataSource": "Form:C1466.message",
"textAlign": "center",
"focusable": false
"focusable": false,
"events": [
"onDoubleClick"
]
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions Project/Sources/Forms/FOOTER/method.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Case of
//______________________________________________________
End case
End if
//______________________________________________________
: ($e.code=On Double Clicked:K2:5)

If (Length:C16(String:C10(Form:C1466.url))>0)
OPEN URL:C673(String:C10(Form:C1466.url))
End if

//______________________________________________________
Else
Expand Down
4 changes: 0 additions & 4 deletions Project/Sources/Methods/COMPILER_API.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@ If (False:C215) // Unit test
C_TEXT:C284(mobileUnit; $1)
C_OBJECT:C1216(mobileUnit; $2)

//_______________________________________
C_OBJECT:C1216(databaseSettings; $0)
C_TEXT:C284(databaseSettings; $1)

//_______________________________________
End if
6 changes: 3 additions & 3 deletions Project/Sources/Methods/RIBBON_HANDLER.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Case of
End if

$isDeviceSelected:=(UI.currentDevice#Null:C1517)
$isSdkAvailable:=cs:C1710.path.new().cacheSdkAndroidUnzipped().exists
$isSdkAvailable:=cs:C1710.path.new().isSdkAndroidExists() || cs:C1710.path.new().isSdkAppleExists()

//______________________________________________________
: (Bool:C1537(UI.ios))
Expand All @@ -141,7 +141,7 @@ Case of

End if

$isSdkAvailable:=True:C214
$isSdkAvailable:=cs:C1710.path.new().isSdkAppleExists()

//______________________________________________________
: (Bool:C1537(UI.android))
Expand All @@ -158,7 +158,7 @@ Case of

End if

$isSdkAvailable:=cs:C1710.path.new().cacheSdkAndroidUnzipped().exists
$isSdkAvailable:=cs:C1710.path.new().isSdkAndroidExists()

//______________________________________________________
End case
Expand Down
60 changes: 0 additions & 60 deletions Project/Sources/Methods/databaseSettings.4dm

This file was deleted.

4 changes: 0 additions & 4 deletions Project/Sources/Methods/mobileUnit.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ If (Asserted:C1132(Count parameters:C259>=1; "Missing parameter"))

End if

//MARK:- checkRest
: ($entryPoint="checkRest")

EXECUTE METHOD:C1007(Formula:C1597(databaseSettings).source; $response; "rest")

//MARK:- checkInstall
: ($entryPoint="checkInstall")
Expand Down
Loading

0 comments on commit d3da59c

Please sign in to comment.