eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ApplicationDefinition':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ApplicationDefinition


Inheritance:

   Object
   |
   +--ProjectDefinition
      |
      +--ApplicationDefinition
         |
         +--stx_projects_webServer

Package:
stx:libbasic
Category:
System-Support-Projects
Version:
rev: 1.350 date: 2019/07/10 16:39:27
user: cg
file: ApplicationDefinition.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Felix Madrid
Claus Gittinger

Description:


subclasses provide the info on the contents of a package/project and
how to build executables and class libraries and how to load/unload packages.
Actually, subclasses MUST be subclasses of the two abstract classes LibraryDefinition or
ApplicationDefinition. These two know how to generate all required help files for the
make/build/load process.
File creation is driven by file templates which are expanded using strings from the file mappings.

Concrete definition classes MUST redefine:
    classNamesAndAttributes
                            list of classes which are part of the dll/exe

    extensionMethodNames
                            list of extension methods

    startupClassName / startupSelector
                            class and selector with which the show starts

    buildTarget             name of the generated exe-file

    
should redefine:
    preRequisites           list of required packages

    iconFileName            name of a .ico file containing the applications icon

    companyName             name of your company - will be shown by windows explorer
                            as attribute of a .dll or .exe

    description             short description; shown by windows explorer

    legalCopyright          copyright message; shown by windows explorer

    productName             product name; shown by windows explorer

    applicationName         app name; shown by windows explorer


might redefine:    
    isConsoleApplication    if true, windows-build generates a console app.

    isGUIApplication        if true, the GUI framework is linked in
                            (as opposed to a non-GUI server-like executable)


The above info might be outdated a bit - see stx_projects_smalltalk as a concrete example.


Related information:

    stx_projects_smalltalk
    stx_libbasic
    stx_libbasic2

Class protocol:

accessing
o  appSourcesProjects
Returns only the application projects (which are included in the application module)

usage example(s):

     bosch_dapasx_application appSourcesProjects

o  startupClass
the class, but only if loaded

o  stxSourcesProjects
Returns only the required STX projects (which are included in the STX module)

usage example(s):

        bosch_dapasx_application stxSourcesProjects

code generation
o  forEachMethodsCodeToCompileDo: aTwoArgBlock ignoreOldDefinition: ignoreOldDefinition
redefined to add application stuff, such as definitions for the app-icon,
startup class and installation directory

o  startupClassName_code
generate code that answers the startupClass.

o  startupClassName_codeFor: aClassName
code that answers aClassName as the startupClass.

o  startupSelector_code
generate code that answers the startupSelector.
Checks if #open or #start are to be used for the startupClass.

o  startupSelector_codeFor: aSelector
generate code that answers aSelector as the startupSelector.

o  subProjects_code
generate code which returns a collection of subproject names.

usage example(s):

     bosch_dapasx subProjects_code
     stx_goodies subProjects_code
     exept_expecco subProjects_code

defaults
o  buildTarget
which target in the Makefile should be built by default?
For now, reasonable return values are 'exe', which builds the executable(s),
and 'ALL', which builds everything, including an installable package.
Here, 'ALL' is returned.
There is usually no need to redefine this default - we at exept do it for the
stx package only to speed up our own build, as we seldom need new install packages,
put often build new executables...

o  extraTargets
extra targets to be built when creating the exe

o  guiClassFileNames_unix

o  guiClassFileNames_win32

o  guiClasses_unix

o  guiClasses_win32
^ Array with:XWorkstation

o  needResources
answer true, if this application
needs resources to be installed. This is normally true.
Even non-GUI apps need some (libbasic/resources)

description
o  additionalFilesToInstall_osx
Each entry gives a pattern of a file to be copied and a destination directory.
Can be redefined in subclasses to install additional files under the Contents/MacOS folder;
to get to a parent folder, pass in a string like '../Library/...'
(keeping OSX specific stuff away from general things, like expecco libs).

o  additionalFilesToInstall_unix
application-specific files to be installed.
Each entry gives a pattern of a file to be copied and a destination directory.
Can be redefined in subclasses.

o  additionalFilesToInstall_win32
application-specific files to be installed.
Each line defines an entry in the NSI file, for a pattern of a file to be copied.
Can be redefined in subclasses.

o  additionalResourceTargets
application-specific additional resource targets to be invoked.
Can be redefined in subclasses.

o  additionalTargetDirectoriesToMakeForInstall_osx
Each entry gives an additional target library to be created under the Contents/MacOS folder;
to get aadditional parent folder, pass in strings like '../Library/...'

o  applicationIconFileName
answer the base-name of the application icon (i.e. 'app' in <app>.ico).

Subclasses MUST redefine this to either return the name of the icon file or
nil, if they do not have one.
We NO LONGER SUPPORT THE PREVIOUS APPNAME-DEFAULT,
because users tend to forget to add the icon file and then get a failing build.

** This method raises an error - it must be redefined in concrete classes **

o  applicationInstallIconFileName
answer the base-name of the installer icon (i.e. 'app' in <app>.ico).

Default is the same as the application icon

o  applicationName
answer the name of the application.
This is also the name of the generated .exe file.

Subclasses may redefine this

usage example(s):

     bosch_dapasx_application applicationName
     stx_projects_smalltalk applicationName

o  documentExtensions
list extensions which should be registered with the application.
Results in the application to be started when double-clicking on such a file (win32)

o  includedInPreRequisites
list packages which are to be implicitely included in the prerequisites list,
even if not found by the automatic search.
Redefine this, if classes from other packages are referred to via reflection
or by constructing names dynamically (i.e. the search cannot find it)

o  initiallyLoadedPreRequisites
Prerequisites packages that are not to be loaded at application startup, but
that maybe loaded later by the application.
This is used for a fast startup in case that the application wants to only inform
an already running application to e.g. open an additional window.

o  isGUIApplication
Return true, if this is a GUI app.
Redefine to return false for non-GUI applications (affects inclusion of Display classes).

o  isSingleThreadedApplication
Return true, if this should be started without multiple threads.
(not possible with gui applications)

o  logFilenameNoConsole
^ (self applicationNameNoConsole , '_%d.log')

o  mainDefines

o  makeConsoleApplication
Used with WIN32 only (i.e. affects bc.mak).
Return true, if this should be built as a console application.
Redefine to return true, if you want one always i.e. to generate both).

o  makeNonConsoleApplication
Used with WIN32 only (i.e. affects bc.mak).
Return true, if this should be built as a non-console application

o  offerApplicationSourceCode
Return true, if the source code of the application should be offered as install option

o  offerSmalltalkSourceCode
Return true, if the source code of the smalltalk base system should be offered as install option

o  osxDmgBackgroundImageFile

o  osxVolumeIconImageFileName

o  runAsAdmin
WINDOWS only! Optionally used by NSI installer.
defines a registry entry,
which sets RUNASADMIN file attribute to the noconsole application exe

o  startupClassName
return he name of the class which provides the entry point for the application;
a fully specified symbol or string.

** This method raises an error - it must be redefined in concrete classes **

o  startupSelector
The name of the entry point method (in startUpClass) used to start the application.

description - private
o  applicationNameConsole
only used for windows builds

o  applicationNameFromPackage
answer the name of the application.
This is also the name of the generated .exe file.

Subclasses may redefine this

usage example(s):

     stx_projects_smalltalk applicationNameFromPackage
     exept_expecco_application applicationNameFromPackage
     bosch_dapasx_application applicationNameFromPackage
     alspa_batch_application applicationNameFromPackage

o  applicationNameNoConsole
only used for windows builds

o  applicationPackage
bosch_dapasx_application applicationPackage
stx_projects_smalltalk applicationPackage
alspa_batch_application applicationPackage

o  commonFilesToInstall_unix
files installed for applications.
Each entry gives a pattern of a file to be copied and a destination directory.
Do not redefine - see additionalFilesToInstall for a redefinable variant of this

o  commonFilesToInstall_win32
files installed for applications - used only for NSIS installer under WIN32.
Each line defines an entry in the NSI file, for a pattern of a file to be copied.
Do not redefine - see additionalFilesToInstall for a redefinable variant of this

o  docDirPath_unix
path relative to my dir to the documentation - or nil

o  docDirPath_win32
path relative to my dir to the documentation - or nil

description - project information
o  applicationType

o  description
Returns a description string which will appear in nt.def / bc.def

o  docDirPath
path relative to my dir to the documentation - or empty.

o  hasLicenceToAcceptDuringInstallation

o  productName
we get this error, if the concrete class has not yet redefined

file generation
o  basicFileNamesToGenerate
answer a dictionary (filename -> generator method) with all the build-support files,
that have to be generated for this package

o  generateFile: filename
for linux

o  generateFile: filename confirmMissingClasses: confirmBoolean
for linux

o  generate_modules_dot_c
bosch_dapasx_application generate_modules_dot_c

o  generate_modules_dot_stx
bosch_dapasx_application generate_modules_dot_stx

o  generate_osx_osascript
stx_clients_Clock_QlockTwoWatchApplication generate_osx_osascript

o  generate_osx_pkginfo

o  generate_packageName_dot_nsi
bosch_dapasx_application generate_packageName_dot_nsi

o  nsiFilename
(comment from inherited method)
only applications define it

file mappings
o  additionalFilesToInstall_dot_nsi: bindings

o  additionalSectionsDescriptions_dot_nsi

o  additionalSectionsDescriptions_dot_nsi: bindings

o  additionalSectionsInsertDescriptions_dot_nsi

o  additionalSectionsInsertDescriptions_dot_nsi: bindings

o  additionalSections_dot_nsi

o  additionalSections_dot_nsi: bindings

o  appSourcesLines_dot_nsi: bindings

o  autopackage_default_dot_apspec_mappings
applicationPackage

o  bc_dot_mak_mappings
windwos make is so stupid

o  bmake_dot_mak_mappings

o  buildDate_dot_h_mappings

o  commonFilesToInstall_dot_nsi: bindings

o  directoryUninstallLines_dot_nsi
%(DIRECTORY_UNINSTALL_LINES)

o  fileExtensionDefinitionLines_dot_nsi: bindings

o  fileExtensionUndefinitionLines_dot_nsi: bindings

o  make_dot_proto_mappings
applicationPackage

o  modules_dot_c_mappings
cvut_fel_izar modules_dot_c_mappings

o  modules_dot_stx_mappings

o  nsiDeliveredConsoleExecutable
made anyway

o  nsiDeliveredExecutables
by default, an executable named after the application.
Redefine, if that's not the case. If multiple have to be delivered,
return a string containing each individually double-quoted.

o  osx_osascript_mappings

o  packageName_dot_nsi_mappings
d at: #'ICONDEFINITION_LINE' put: 'IDR_MAINFRAME ICON DISCARDABLE "',s,'"'

o  preRequisiteLine_bc_dot_mak_mappings: aProjectID

o  preRequisiteLine_bc_dot_mak_mappingsForClass: aClass

o  preRequisiteLine_make_dot_proto_mappings: aProjectID

o  preRequisiteLine_make_dot_proto_mappingsForClass: aClass

o  runAsAdminDefinitionLines_dot_nsi: bindings

o  runAsAdminUndefinitionLines_dot_nsi: bindings

o  stxSourcesLines_dot_nsi: bindings

o  subProjectLine_bc_dot_mak_mappings: aProjectID

o  subProjectLine_make_dot_proto_mappings: aProjectID

file mappings support
o  allPackagesForResources

o  generateAllPreRequisiteLibs_modules_dot_stx
exept_expecco_application generateAllPreRequisiteLibs_modules_dot_stx

o  generateExtensionLine: extensionLineTemplate

o  generatePreRequisiteLibs_modules_dot_stx
exept_expecco_application generatePreRequisiteLibs_modules_dot_stx

o  generatePreRequisiteLines_bc_dot_mak
bosch_dapasx_application generatePreRequisiteLines_bc_dot_mak

o  generatePreRequisiteLines_make_dot_proto
exept_expecco_application generatePreRequisiteLines_bc_dot_mak

o  generateRequiredLibobjs_make_dot_proto
exept_expecco_application generateRequiredLibobjs_make_dot_proto

o  generateRequiredLibs_bc_dot_mak
Subprojects are not linked to the exe!

usage example(s):

     bosch_dapasx_application generateRequiredLibs_bc_dot_mak      

o  generateRequiredLibs_make_dot_proto
cg: why not (self libraryNameFor:projectID),'.so'; ???

usage example(s):

     alspa_batch_application generateRequiredLibs_make_dot_proto      

o  generateRequiredLinkLibobjs_make_dot_proto
self subProjects do:[:projectID |

usage example(s):

     alspa_batch_application generateRequiredLinkLibobjs_make_dot_proto      

o  generateResourceCopyLines_bc_mak
exept_expecco_application generateResourceCopyLines_make_dot_proto
exept_expecco_application allPreRequisitesSorted
exept_expecco_application allPackagesForResources
exept_expecco_application generateResourceCopyLines_bc_mak

o  generateResourceCopyLines_make_dot_proto
exept_expecco_application generateResourceCopyLines_make_dot_proto
exept_expecco_application allPreRequisitesSorted
exept_expecco_application allPackagesForResources
exept_expecco_application make_dot_proto_resource_rules

o  generateSubProjectLibs_bc_dot_mak
exept_expecco_application generateSubProjectLibs_bc_dot_mak
cg_newCompiler_driver_stc generateSubProjectLines_bc_dot_mak

o  generateSubProjectLibs_make_dot_proto
exept_expecco_application generateSubProjectLibs_make_dot_proto
self generateSubProjectLibs_make_dot_proto

o  generateSubProjectLines_bc_dot_mak
exept_expecco_application generateSubProjectLines_bc_dot_mak
bosch_dapasx_application generateSubProjectLines_bc_dot_mak
cg_newCompiler_driver_stc generateSubProjectLines_bc_dot_mak

o  generateSubProjectLines_make_dot_proto
exept_expecco_application generateSubProjectLines_make_dot_proto
cg_newCompiler_driver_stc generateSubProjectLines_make_dot_proto

o  generateSubProjectLines_modules_dot_stx
exept_expecco_application generateSubProjectLines_modules_dot_stx
cg_newCompiler_driver_stc generateSubProjectLines_modules_dot_stx

file templates
o  bc_dot_def
the template code for the bc.def file

o  bc_dot_mak
answer a template for the bc.mak makefile.
Any variable definition %(Variable) will be later replaced by the mapping.
$% characters have to be duplicated

o  bc_dot_mak_app_source_rules

o  bc_dot_mak_resource_rules

o  bc_dot_mak_stx_resource_rules

o  bc_dot_mak_stx_source_rules

o  bmake_dot_mak
the template code for the bmake.bat file
Notice: duplicate %'s if they are needed as such in the generated file

o  buildDate_dot_h
the template code for the buildDate.h file

o  classLine_modules_dot_c

o  classLine_modules_dot_c_extern

o  defineAPPSourceLine_nsi_for: projectID

o  defineExtenionLine_nsi_for: extension
the template code for a single extenions definition line in the <appname>.nsi file

o  defineExtensionLine_nsi_for: extension
the template code for a single extenions definition line in the <appname>.nsi file

o  defineSTXSourceLine_nsi_for: projectID

o  extensionsLine_modules_dot_c

o  extensionsLine_modules_dot_c_extern

o  installFileLine_nsi_for: filePattern
the template code for a single file-install pattern to be added to the <appname>.nsi file

o  linuxSetupRules
this is sliced into the generated Make.proto file

o  make_dot_proto
,' at ',Timestamp now printString

o  make_dot_proto_app_source_rules

o  make_dot_proto_app_source_rules_for: projectID

o  make_dot_proto_resource_rules

o  make_dot_proto_source_title_for: projectID

o  make_dot_proto_stx_resource_rules
non-GUI app: only include libbasic resources (for Date)

o  make_dot_proto_stx_source_rules

o  make_dot_proto_stx_source_rules_for: projectID

o  modules_dot_c

o  modules_dot_stx

o  osxDmgImageSetupLines
generate (OSX unix) copy commands to generate a directory holding the dmg prototype image directory.
This is used to generate a macOS deployable dmg containing an app

o  osxPkgDistributionScript
unfinished.
generate (OSX unix) copy commands to generate a directory holding the pkg prototype image directory.
This is used to generate a macOS deployable pkg containing libraries or non-GUI programs

o  osxPkgImageSetupLines
generate (OSX unix) copy commands to generate a directory holding the pkg prototype image directory.
This is used to generate a macOS deployable pkg containing libraries or non-GUI programs

o  osxSetupRules
this is sliced into the generated Make.proto file

o  osxSetupRules_forDMG
this is sliced into the generated Make.proto file

o  osxSetupRules_forPKG
this is sliced into the generated Make.proto file

o  osx_osascript
generate (OSX unix) osa script commands to arrange the dmg folder being shown.
This is used to generate a macOS deployable dmg

o  packageName_dot_nsi
the template code for the <appname>.nsi file

usage example(s):

     bosch_dapasx_application packageName_dot_nsi
     bosch_dapasx_application generateFile:'dapasx.nsi'

o  packageName_dot_rc
the template code for the <appname>.rc file

usage example(s):

     stx_libbasic3 packageName_dot_rc
     stx_libbasic3 generate_packageName_dot_rc

o  preRequisiteLine_bc_dot_mak
Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
is required!

o  preRequisiteLine_make_dot_proto
Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
is required!

o  subProjectLine_bc_dot_mak
Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
is required!

o  subProjectLine_make_dot_proto
Note: the trailing blank in 'CFLAGS_LOCAL=$(GLOBALDEFINES) '
is required!

o  undefineExtenionLine_nsi_for: extension
the template code for a single extenions undefinition line in the <appname>.nsi file

o  undefineExtensionLine_nsi_for: extension
the template code for a single extenions undefinition line in the <appname>.nsi file

queries
o  definitionClassOfApplicationBundle
Return the applicationDefinition of the applicationBundle or nil.
This is the applicationDefinition of the package which gets actually deployed.
This information is currently used for automatic check of language translations.
Here, ssume that I am the bundle.
Redefine in other applications if that is not true.

usage example(s):

     exept_expecco definitionClassOfApplicationBundle    
     exept_expecco_application definitionClassOfApplicationBundle    
     exept_expecco_plugin_swt definitionClassOfApplicationBundle    

o  isAbstract

o  projectType

o  shouldBeLoadedInitially: aProjectID
answer true, if a class should not be loaded initially,
but explicitly later by the application

sanity checks
o  validateDescription
perform some consistency checks (set of classes in project same as those listed in description);
called before checking in build support files

testing
o  isApplicationDefinition
(comment from inherited method)
true iff an application-package (i.e. not a library).
Applications have a main and startup for standalon start

o  isConsoleApplication
Used with WIN32 only (i.e. affects bc.mak).
Return true, if this is a console application.
Console applications have stdout and stderr and open up a command-window
when started. Only console applications can interact with the user in the
command line window.
By default, GUI apps are compiled as non-console apps.
If you need both (as in expecco), redefine this as true AND in addition redefine
makeConsoleApplication to return true.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 26 May 2022 11:40:49 GMT