Představujeme nejnovější iteraci komponenty Build4D, která je nyní dostupná na GitHubu. V předchozích příspěvcích na blogu jsme se zabývali možnostmi zkompilovaného projektu, komponenty a samostatné aplikace.
Nyní můžete vytvořit skript pro svou klientskou/serverovou aplikaci od A do Z. A snadno jej integrovat s nástroji pro kontinuální integraci.
Podívejme se, jak na to.
Jaké jsou možnosti?
Build4D nabízí dvě třídy pro generování vaší aplikace klient/server: třídu klient a třídu server. S různými parametry jsou tedy možné všechny myslitelné kombinace.
Můžete generovat např:
- klienty pro MacOS a/nebo Windows,
- klientské archivy pro macOS a/nebo Windows pro automatické aktualizace,
- servery pro macOS a/nebo Windows.
Příklad:
Zde je jednoduchý příklad vytvoření serveru Windows s integrovanými klienty:
Krok 1: Vytvoření klienta a archivu klienta
Zde je jednoduchý příklad, jak vytvořit klientskou aplikaci a klientský archiv.
var $build : cs.Build4D.Client
var $settings ; $archive: Object
var $success : Boolean
$settings :={}
// Define the external project file
$settings .projectFile:=Folder(fk documents folder).file("Kontakt/Projekt/Kontakt.4DProject")
// Define the 4D Volume Desktop path
$settings .sourceAppFolder:=Folder(fk documents folder).folder("4D v20.1/4D Volume Desktop.app")
// OR
$settings .sourceAppFolder:=Folder(fk documents folder).folder("4D v20.1/4D Volume Desktop")
// Configure the application
$settings .buildName:="myApp"
$settings .destinationFolder:="Test/Client/"
// Add the application icon
$settings .iconPath:="/RESOURCES/myIcon.icns"
// OR
$settings .iconPath:="/RESOURCES/myIcon.ico"
// Add the application information
$settings .versioning:={}
$settings .versioning.version:="version"
$settings .versioning.copyright$archive$buildbuildArchive:="copyright"
$settings .versioning.companyName:="companyName"
// Sign if macOS appplication
$settings .signApplication:={}
$settings .signApplication.macSignature:=True
$settings .signApplication.macCertificate:="xxxxxx" //Certificate number found in your keyChain
// Create the client application
$build :=cs.Build4D.Client.new($settings)
$success :=$build.build()
// Create the client application archive
$archive:=$build.buildArchive()
Krok2: Vytvoření serveru s integrovanými klienty
Po vytvoření klientského archivu (jako v příkladu výše) můžete vytvořit serverovou aplikaci a pomocí atributů macOSClientArchive a winClientArchive předat cestu k dříve vytvořeným klientským archivům.
Zde je příklad vytvoření serverové aplikace s klientskými archivy.
var $build : cs.Build4D.Server
var $settings : Object
var $success : Boolean
$settings :={}
// Define the external project file
$settings .projectFile:=Folder(fk documents folder).file("Kontakt/Projekt/Kontakt.4DProject")
// Configure the application
$settings .buildName:="myApp"
$settings .destinationFolder:="Test/Server/"
// Define the 4D Server path
$settings .sourceAppFolder:=Folder(fk documents folder).folder("4D v20.0/4D Server.app")
// OR
$settings .sourceAppFolder:=Folder(fk documents folder).folder("4D v20.0/4D Server")
// Add the application icon
$settings .iconPath:="/RESOURCES/myIcon.icns"
// OR
$settings .iconPath:="/RESOURCES/myIcon.ico"
// Add the application information
$settings .versioning:={}
$settings .versioning.version:="verze"
$settings .versioning.copyright:="copyright"
$settings .versioning.companyName:="companyName"
// Add the client archives
$settings .macOSClientArchive:="...cesta macOS Archive..."
$settings .windowsClientArchive:="...cesta win Archive..."
// Create the deployment license file for OEM partner
$settings .license$buildbuild:=Folder(fk licenses folder).file("XXXXX.license4D")
$settings .xmlKeyLicense:=Folder(fk licenses folder).file("XXXXX.license4D")
// Sign if macOS appplication
$settings .signApplication:={}
$settings .signApplication.macSignature:=True
$settings .signApplication.macCertificate:="xxxxxx"
//Certificate number found in your keyChain
// Launch the build
$build :=cs.Build4D.Server.new($settings)
$success:=$build.build()
Další…
Prozkoumejte dokumentaci a získejte další informace o této nové možnosti!