Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d7bbf66
Standalone creation
DamienFuzeau Apr 16, 2023
43b8e63
Checking sourceApp version
DamienFuzeau Apr 18, 2023
73f9c63
Application icon integration
DamienFuzeau Apr 18, 2023
451736e
License generation
DamienFuzeau Apr 19, 2023
b46ad0d
Set the lastDataPathLookup option
DamienFuzeau May 5, 2023
96e0e2b
Define application information
DamienFuzeau May 10, 2023
25fcdee
Set the SDI mode
DamienFuzeau May 10, 2023
8d33cbf
Elevate Updater privileges on Windows
DamienFuzeau May 11, 2023
1f3a6b1
Modules exclusion
DamienFuzeau May 12, 2023
03e85ae
Add doc for standalone
vanessa-talbot May 23, 2023
5ab2d7f
Update readme and add example
vanessa-talbot May 25, 2023
f4517e2
Bug fixes
DamienFuzeau Jun 7, 2023
4e57d5e
Bug fixes
DamienFuzeau Jun 8, 2023
4ea1673
All file/folder parameters can use File/Folder object or string paths…
DamienFuzeau Jun 8, 2023
10ddbe0
Delete buildApp.4DSettings
DamienFuzeau Jun 9, 2023
c3af372
Base path changes + corresponding UTs + TU folder refactoring
DamienFuzeau Jun 9, 2023
69fd1ae
Update Doc
vanessa-talbot Jun 12, 2023
5bb46f9
Unit Tests part #1
DamienFuzeau Jun 12, 2023
c6a671f
Update example in the Standalone doc
vanessa-talbot Jun 27, 2023
9e43fe5
Unit Tests
DamienFuzeau Jun 27, 2023
1ff4bcd
Merge branch 'dev_standalone' of https://github.com/4d-depot/Build4D …
DamienFuzeau Jun 27, 2023
c14c2be
User manual for Build4D_UnitTests in the README file
DamienFuzeau Jun 28, 2023
44895b3
Add example with dependent component
vanessa-talbot Jul 4, 2023
389ab38
English check for _core.md
mouna-elmaazouzi Jul 5, 2023
626b9cf
English check for Standalone.md
mouna-elmaazouzi Jul 5, 2023
d449a8e
Update English check for Standalone.md
mouna-elmaazouzi Jul 5, 2023
839526b
English check update CompiledProject.md
mouna-elmaazouzi Jul 5, 2023
397b370
English check update Component.md
mouna-elmaazouzi Jul 5, 2023
ff76dcf
Add dependency component
vanessa-talbot Jul 6, 2023
946ac42
Update example with object literal syntax
vanessa-talbot Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ userPreferences.*/

# Other
Project/Trash
Settings/buildApp.4DSettings

# System files
.DS_Store
Expand All @@ -23,8 +22,11 @@ Thumbs.db
*.4dbase/
UT_*.log
Build_*.log
*.license4D
Artifacts/
Test/
Build/
Build4D_UnitTests_Build/
Build4D_External_Build/
zzz*.4dm

# Build
*Test/
*Build/
*buildApp.4DSettings
22 changes: 11 additions & 11 deletions Build4D/Documentation/Classes/CompiledProject.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Type your summary here -->
## Description

This class allows you to create a compiled project. It is composed of:
This class allows you to create a compiled project. It is composed of the following:

* a [Class constructor](#class-constructor)
* a [build()](#build) function
Expand All @@ -13,22 +13,22 @@ Class constructor($customSettings : Object)
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $customSettings | Object | in | $customSettings is a custom settings object overriding target default settings stored in "/RESOURCES/CompiledProject.json" file |
| $customSettings | Object | in | $customSettings is a custom settings object overriding target default settings stored in the "/RESOURCES/CompiledProject.json" file. |

$customSettings is an object that contains the following parameters:

| Attributes | Type | Description |
|---|---|---|
|buildName | String | Name of the target build. Defined by the component if missing in the custom settings.|
|projectFile | File or String | Project file. Pass the project file path if you want to build an external project. Not necessary if it is a current project.|
|destinationFolder | Folder or String | Folder where the build will be generated. Defined by the component if missing in the custom settings.|
|compilerOptions | Object | Compile options. The object is passed as parameter to the "Compile project" command if is not null.|
|buildName | String | Name of the target build, defined by the component if missing in the custom settings.|
|projectFile | File or String | Project file (relative to the open project/absolute/filesystem). Pass the project file path if you want to build an external project (not necessary if building the current project).|
|destinationFolder | Folder or String | Folder where the build will be generated (relative to the open project/absolute/filesystem), defined by the component if missing in the custom settings.|
|compilerOptions | Object | Compile options. The object is passed as parameter to the "Compile project" command if it is not null. For more details about the object format, read the documentation of the Compile project command.|
|packedProject | Boolean | True if the project is compressed into a 4DZ file.|
|obfuscated | Boolean | True if the 4DZ shall not be dezippable.|
|obfuscated | Boolean | True if the 4DZ is to not be dezippable.|
|includePaths[] | Collection of Objects | Collection of folders and files to include.|
|includePaths[].source | String | Source folder or file path (relative to the built project/absolute/filesystem strings).|
|includePaths[].destination | String | Destination folder path (relative to the built project/absolute/filesystem strings).|
|deletePaths[] | Collection of Strings | Collection of paths to folders and files to be deleted (relative to the built project/absolute/filesystem strings).|
|includePaths[].source | Folder, File, or String | Source folder or file path (relative to the open project/absolute/filesystem strings).|
|includePaths[].destination | Folder, File, or String | Destination folder path (relative to the built project/absolute/filesystem).|
|deletePaths[] | Collection of Folders, Files, or Strings | Collection of paths to folders and files to be deleted (relative to the built project/absolute/filesystem).|
|logger | Formula | Formula called when a log is written.|

### build()
Expand All @@ -38,7 +38,7 @@ Function build() -> $status : Boolean
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $status | Boolean | out | True if the build has been correctly executed |
| $status | Boolean | out | True if the build has been correctly executed. |

Builds the compiled project.

Expand Down
22 changes: 11 additions & 11 deletions Build4D/Documentation/Classes/Component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Type your summary here -->
## Description

This class allows you to create a component. It is composed of:
This class allows you to create a component. It is composed of the following:

* a [Class constructor](#class-constructor)
* a [build()](#build) function
Expand All @@ -13,22 +13,22 @@ Class constructor($customSettings : Object)
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $customSettings | Object | in | $customSettings is a custom settings object overriding target default settings stored in "/RESOURCES/Component.json" file |
| $customSettings | Object | in | $customSettings is a custom settings object overriding target default settings stored in the "/RESOURCES/Component.json" file. |

$customSettings is an object that contains the following parameters:

| Attributes | Type | Description |
|---|---|---|
|buildName | String | Name of the target build. Defined by the component if missing in the custom settings.|
|projectFile | File or String | Project file. Pass the project file path if you want to build an external project. Not necessary if it is a current project.|
|destinationFolder | Folder or String | Folder where the build will be generated. Defined by the component if missing in the custom settings.|
|compilerOptions | Object | Compile options. The object is passed as parameter to the "Compile project" command if is not null.|
|buildName | String | Name of the target build, defined by the component if missing in the custom settings.|
|projectFile | File or String | Project file (relative to the open project/absolute/filesystem). Pass the project file path if you want to build an external project (not necessary if building the current project=.|
|destinationFolder | Folder or String | Folder where the build will be generated (relative to the open project/absolute/filesystem), defined by the component if missing in the custom settings.|
|compilerOptions | Object | Compile options. The object is passed as parameter to the "Compile project" command if it is not null. For more details about the object format, read the documentation of the Compile project command.|
|packedProject | Boolean | True if the project is compressed into a 4DZ file.|
|obfuscated | Boolean | True if the 4DZ shall not be dezippable.|
|obfuscated | Boolean | True if the 4DZ is to not be dezippable.|
|includePaths[] | Collection of Objects | Collection of folders and files to include.|
|includePaths[].source | String | Source folder or file path (relative to the built project/absolute/filesystem strings).|
|includePaths[].destination | String | Destination folder path (relative to the built project/absolute/filesystem strings).|
|deletePaths[] | Collection of Strings | Collection of paths to folders and files to be deleted (relative to the built project/absolute/filesystem strings).|
|includePaths[].source | Folder, File, or String | Source folder or file path (relative to the open project/absolute/filesystem).|
|includePaths[].destination | Folder, File, or String | Destination folder or file path (relative to the built project/absolute/filesystem).|
|deletePaths[] | Collection of Folders, Files, or Strings | Collection of paths to folders and files to be deleted (relative to the built project/absolute/filesystem strings).|
|signApplication.macSignature | Boolean | Signs the built applications.|
|signApplication.macCertificate | String | Certificate name used for signature.|
|signApplication.adHocSignature | Boolean | Signs the built applications with AdHoc signature if macSignature not performed.|
Expand All @@ -41,7 +41,7 @@ Function build() -> $status : Boolean
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $status | Boolean | out | True if the build has been correctly executed|
| $status | Boolean | out | True if the build has been correctly executed.|

Build the component.

Expand Down
137 changes: 137 additions & 0 deletions Build4D/Documentation/Classes/Standalone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<!-- Type your summary here -->
## Description

This class allows you to create a standalone application. It is composed of the following:

* a [Class constructor](#class-constructor)
* a [\_renameExecutable](#renameExecutable) function
* a [build()](#build) function

### Class constructor

```4D
Class constructor($customSettings : Object)
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $customSettings | Object | in | $customSettings is a custom settings object overriding target default settings stored in the "/RESOURCES/Standalone.json" file. |

$customSettings is an object that contains the following parameters:

| Attributes | Type | Description |
|---|---|---|
|buildName | String | Name of the target build, defined by the component if missing in the custom settings.|
|projectFile | File or String | Project file (relative to the open project/absolute/filesystem). Pass the project file path if you want to build an external project (not necessary if building the current project).|
|destinationFolder | Folder or String | Folder where the build will be generated (relative to the open project/absolute/filesystem), defined by the component if missing in the custom settings.|
|sourceAppFolder| Folder or String | Folder of the 4D Volume Desktop (relative to the open project/absolute/filesystem).|
|compilerOptions | Object | Compile options. The object is passed as parameter to the "Compile project" command if it is not null. For more details about the object format, read the documentation of the Compile project command.|
|packedProject | Boolean | True if the project is compressed into a 4DZ file.|
|obfuscated | Boolean | True if the 4DZ is to not be dezippable.|
|lastDataPathLookup| String | Defines the way the application stores its link with the last data file. Possible values: "ByAppName" (Default value) and "ByAppPath".|
|useSDI| Boolean | Allows to use the SDI interface mode instead of the MDI (Windows only).|
|startElevated| Boolean | Allows to start the Updater with elevated privileges (Windows only).|
|iconPath| File or String | File path of the icon to be used instead of the 4D Volume Desktop icon.|
|versioning| Object | Object containing the contents of the application information.|
|versioning.version| String | Version number. |
|versioning.copyright| String | Copyright text. |
|versioning.companyName| String | Company name. |
|versioning.fileDescription| String | Description (Windows only).|
|versioning.internalName| String | Internal name (Windows only).|
|includePaths[] | Collection of Objects | Collection of folders and files to include.|
|includePaths[].source | Folder, File, or String | Source folder or file path (relative to the open project/absolute/filesystem).|
|includePaths[].destination | Folder, File, or String | Destination folder path (relative to the built project/absolute/filesystem).|
|deletePaths[] | Collection of Folder, File, or Strings | Collection of paths to folders and files to be deleted (relative to the built project/absolute/filesystem strings).|
|excludeModules| Collection of Strings | Collection of module names to exclude from final application. The module names can be found in the "BuildappOptionalModules.json" file in the resources of the 4D application.|
|license| File or String | Unlimited desktop license file (relative to the built project/absolute/filesystem).|
|signApplication.macSignature | Boolean | Signs the built applications.|
|signApplication.macCertificate | String | Certificate name used for signature.|
|signApplication.adHocSignature | Boolean | Signs the built applications with AdHoc signature if macSignature not performed.|
|logger | Formula | Formula called when a log is written.|

<h3 id="renameExecutable">_renameExecutable</h3>

```4D
Function _renameExecutable() -> $status : Boolean
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $status | Boolean | out | True if the executable has been correctly renamed. |

Renames the executable.

### build()

```4D
Function build() -> $status : Boolean
```
| Parameter | Type | in/out | Description |
|---|---|---|---|
| $status | Boolean | out | True if the standalone has been correctly executed.|

Builds the standalone application.

## Example

This code is an example to generate a standalone application from an external project.

```4D
var $build : cs.Build4D.Standalone
var $settings : Object
var $success : Boolean

$settings:={}

// Define the external project file
$settings.projectFile:=Folder(fk documents folder).file("Contact/Project/Contact.4DProject")

// Configure the application
$settings.buildName:="myApp"
$settings.destinationFolder:="Test/"
$settings.obfuscated:=True
$settings.packedProject:=True
$settings.useSDI:=False
$settings.startElevated:=False
$settings.lastDataPathLookup:="ByAppPath"

// Specify the components required for compilation
$componentsFolder:=Folder(fk documents folder).folder("4D v20.0/4D.app/Contents/Components")
$components:=[]
$components.push($componentsFolder.file("4D WritePro Interface.4dbase/4D WritePro Interface.4DZ"))
$settings.compilerOptions:={components: $components}

// Define the 4D Volume Desktop path
$settings.sourceAppFolder:=Folder(fk documents folder).folder("4D v20.0/4D Volume Desktop.app")

// Delete the unnecessary module
$settings.excludeModules:=["CEF"; "MeCab"]

// Include the folders and files
$settings.includePaths:=[]
$settings.includePaths.push({source: $componentsFolder.folder("4D WritePro Interface.4dbase").path; destination: "../Components/"})
$settings.includePaths.push({source: $componentsFolder.folder("4D SVG.4dbase").path; destination: "../Components/"})

// Delete the folders and files
$settings.deletePaths:=[]
$settings.deletePaths.push("Resources/Dev/")

// Add the application icon
$settings.iconPath:="/RESOURCES/myIcon.icns"

// Add the application information
$settings.versioning:={}
$settings.versioning.version:="version"
$settings.versioning.copyright:="copyright"
$settings.versioning.companyName:="companyName"

// Create the deployment license file
$settings.license:=Folder(fk licenses folder).file("XXXXX.license4D")

// Sign the macOS appplication
$settings.signApplication:={}
$settings.signApplication.macSignature:=True
$settings.signApplication.macCertificate:="xxxxxx"

// Launch the build
$build:=cs.Build4D.Standalone.new($settings)
$success:=$build.build()
```
Loading