Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Process For Endurance #3

Open
starandtina opened this issue Sep 9, 2014 · 0 comments
Open

Build Process For Endurance #3

starandtina opened this issue Sep 9, 2014 · 0 comments

Comments

@starandtina
Copy link
Owner

Building Process

Build Tools

Ant

  • fnd-webserver-endurance/server/release.sh: cover the release workflow, including tag, branch, publish, depoly
  • fnd-webserver-endurance/server/ant.sh: find out the BuildTools and
  • run it: ./ant.sh clean main run

Buildfiles

  • build.xml: the main build file for endurance project
  • ${BUILDTOOLS_DIR}/build-core.xml
  • ${BUILDTOOLS_DIR}/build-html.xml: it’s used to build JavaScript/HTML/CSS
  • ${BUILDTOOLS_DIR}/build-shared.xml: common configuration, ivy, release
  • ${BUILDTOOLS_DIR}/task-release-service.xml: deploy, run

I’m not very sure about the responsibility for every build file based on the tasks it had defined. It seems it scatters everywhere.

Dependency Manager Tool

Ivy

Build Process of Endurance

  1. clean(build.xml)
    1. build-shared.clean: clean build directory named target
    2. ui-clean
      1. flex-sdk-init
      2. flex-sdk-check,flex-sdk-pre-init,-flex-sdk-init,flex-sdk-post-init
  2. svn update ${BUILDTOOLS_DIR}
  3. prep-release(task-release-server.xml)
    1. releasePrep: task defined in com.active.buildsupport.ant.ReleaseSupportPrep located in ${BUILDTOOLS_DIR}/ant/lib/buildsupport-0.0.8.jar;
    2. version: task defined com.active.buildsupport.ant.BuildNumberSupport located in ${BUILDTOOLS_DIR}/ant/lib/buildsupport-0.0.8.jar
  4. _publish-release(build-shared.xml)
    1. clean: the same as step one;
    2. init
      1. -init
      2. -classpath-init
      3. -post-init
    3. resolve(_ivy-init,init,_internal-resolve,_write-classpath): resolve dependencies with ivy
    4. build(build-core.xml):
      1. compile Java source files and save them to ${build.dir}/classes
      2. copy resources files located in src/main/resources to ${build.dir}/classes
    5. dist
      1. main(init,resolve,build,_build-tests,_jar,codeine,_deploy-local): the most important part is the _deploy-local target
        1. copy lib/config/webapp/classes/resources files to one temp dir based on target/runtime/core-server-*.zip
        2. call -copy-project-files target in order to build optimised JavaScript/HTML/CSS
        3. deploy it into local directory base on your OS
          1. unix: ${user.home}/active(unix.xml)
          2. windows: c:/creative(windows.xml)
        4. _build-zip: generate zip file
    6. test
    7. _ivy-publish-release
  5. finish-release(task-release-service.xml)
    1. svn-path(build-shared.xml): execute svn info —xml . and extract the svn path
    2. _finish-release(build-shared.xml): execute release task defined in com.active.buildsupport.ant.ReleaseSupport
    3. install-release(task-release-service.xml): deploy it to remote machine
      1. SCP zip source file to remote machine;
      2. Email the change log to all;
      3. Bootstrap Service Workflow: Stopping Service -> Uninstalling previous version -> Installing Service -> Update service.properties -> Starting Service

Build process of Frontend for New AUI Style Guide

The main ant task for it is -copy-project-files located in build.xml which depends on task of consumeArchHtmlForAUI, optimizeHtmlLess.

  1. Consumes the arch-html artifact to be used in the AUI, ach-html is the zip file for AUI components.
    1. unzip arch-html-1.0.0.0-SNAPSHOT.zip which is the latest version for that;
    2. copy active/fnd/arch/ and active/fnd/aui/ to source dir(src/main/webapp)
  2. Optimising HTML/JS/CSS in the webapp directory, the steps for optimisation shows as below:
    1. Step 1: SetupOptimizeHtml
      • remove previous built files and setup a clean environment;
      • copy all files from src/main/webapp to temporary directory of target/optimize-html
    2. Step 2 Build manifest for RequireJS: it’s defined in com.active.buildsupport.ant.html.CreateRequireManifestTask
      • generate compiled.require.manifest.js file which includes almost all of the AUI and endurance modules used by r.js
      1. Step 3 Compile JavaScript: using r.js to run the RequireJS optimizer in Rhino env
        • resolve and tracing the dependencies;
        • compile all components(including AUI and Endurance components) into one file named compiled.js
      2. Step 4 Minify JavaScript: minify compiled.js with Closure Compiler;
      3. Step 5 GZip JavaScript: create a gzip version for compiled.min.js and output compiled.min.js.gz
      4. Step 6 Combine LESS: Combine LESS files of src/main/webapp/main.less linked via ‘@import’ into one LESS file named combined.less;
      5. Step 7 Compile LESS: compile combined.less file into compile.css in Rhino env with LESS;
      6. Step 8 CompileCssSprites: Compile CSS images into one png file;
      7. Step 9 Minify CSS: minify compiled.css with YUI Compressor and output compiled.min.css.
      8. Step 10 GZip CSS: Create a gzip version for compiled.min.css and output compiled.min.css.gz
      9. Step 11 Create Locales: it’s defined in com.active.buildsupport.ant.locales.CreateLocalesTask
        • creates the locales files from the _.properties files located in the subdirectories of the _src/main/resources/locale* directory
        • there will be one _.properties file created for each sub directory of the _src/main/resources/locale* directory.
        • copy locales to src/main/webapp/active/fnd/arch/locale
        • available locales: da_DK,de_AT,de_CH,de_DE,en_AU,en_CA,en_GB,en_IE,en_NZ,en_US,en_ZA,es_ES,es_MX,fr_CA,fr_CH,fr_FR,it_CH,it_IT,ja_JP,ko_KR,pt_BR,sv_SE,zh_CN,zh_HK,zh_SG,zh_TW
      10. Step 12 Gzip Locales: Creates a gzip version for each property file
      11. Step 13 copy optimised HTML/JS/CSS files into src/main/webapp and delete temporary files and directories generated during build process.
  3. Files we have created
  • compiled.js: including almost all of common libraries and business codes, such as RequireJS, jQuery, Bootstrap, AUI Components, kinds of jQuery plugins(Typeahead, Address, etc…), and endurance components, but excluding Backbone.js and Underscore.js.
  • compiled.css: including AUI/Endurance Components styles and all of the business styles of AWE;
  • compiled.min.js: minified version of compiled.js;
  • compiled.min.css: minified version of compiled.css

Maybe you have noticed that it’s using LESS as the default css preprocessor, I guess it's because of that LESS is written in JavaScript and we could run it with Rhino env directly, also Bootstrap uses LESS instead of SASS.

Build process of Frontend for Old AUI Style Guide

It almost has the same process with New AUI style guide except it doesn’t handle LESS and include csssprites.

  • Step 1: SetupOptimizeHtml
  • Step 2: Build manifest for RequireJS
  • Step 3: Compile JavaScript
  • Step 4: Minify JavaScript
  • Step 5: Gzip JavaScript
  • Step 6: Compile CSS
    • Combine CSs files of src/main/webapp/main.css linked via ‘@import’ into one LESS file named compiled.css
  • Step 7: CompileCssSprites
    • Compile CSS images into one png file;
  • Step 8: Minify CSS
  • Step 9: Gzip CSS
  • Step 10: Create Locales
  • Step 11: Gzip Locales
  • Step 12: copy optimised files into src/main/webapp and clean
@starandtina starandtina changed the title Endurance Frontend Build Process Build Process For Endurance Sep 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant