Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Optimizing SASS compilation to reduce the server startup time

Canvas enables you to optimize the SASS compilation process for your web application before you proceed to build and deploy your web application. For detailed information on building a web application, refer Building Your First Web Application. To optimize SASS compilation for reducing the server startup time, perform the following steps:

  1. It is mandatory for you to uncomment the antcall target function in the build xml (e.g. buildModelHouse.xml) file present in your project source folder, e.g. D:\SVN_REPO\19.1.7.3\Sources\CTModelHouse\Sources\CTModelHouseServerBuilder\src\main\ant\buildModelHouse.xml. The following code snippet serves as a sample reference:

    Code Block
    languagexml
    <!-- Css compresion is done here -->

...

  1. 
    		 <antcall target="-build.modelhouse.compresscss" />

...

  1.  
    		<antcall target="package_compile_sass" /

...

  1. > <!-- Uncomment the antcall target function -->
    		<jar destfile="${MODEL_WAR_FILE_NAME}">

...

  1. 
    			<fileset dir="${WAR_ROOT}">

...

  1. 
    				<include name="**/*.*" />

...

  1. 
    			</fileset>

...

  1. 
    			<manifest>
    				<attribute name="Created-By" value="${unit.name}" />

...

  1. 
    				<attribute name="Build-Jdk" value="${java.version}" />

...

  1. 
    				<attribute name="Bundle-Name" value="modelhouse war" />

...

  1. 
    				<attribute name="Bundle-Version" value="${product.version}" />

...

  1. 
    				<attribute name="Bundle-Description" value="Web application archive for the modelhouse" />

...

  1. 
    				<attribute name="Implementation-Vendor" value="${company.name}" />

...

  1. 
    				<attribute name="Implementation-Title" value="${product.name}" />

...

  1. 
    				<attribute name="Implementation-Version" value="${product.version}" />

...

  1. 
    				<attribute name="Build-Id" value="${buildVersion}" />

...

  1. 
    				<attribute name="Build-Date" value="${DATE}"/>

...

  1. 
    			</manifest>

...

  1. 
    		</jar>


  2. Once you execute and generate the database scripts for your web application, you must specify the database or schema name in the same build xml file (e.g. buildModelHouse.xml), present in your project source folder, e.g. D:\SVN_REPO\19.1.7.3\Sources\CTModelHouse\Sources\CTModelHouseServerBuilder\src\main\ant\buildModelHouse.xml. The following code snippet serves as a sample reference:

...

  1. Note

    For setting up a development environment and to execute and generate DB scripts for your web application, refer Setup Development Environment for Canvas Technology.


    Code Block
    languagexml
    <!-- Prepare the CSS Files (compile sass, merge and minify)-->

...

  1. 
    	<target name="package_compile_sass">

...

  1. 
    		<echo>Compiling SASS and CSS File merge / minify</echo>

...

  1. 
    		<java classname="com.intellectdesign.canvas.utils.BuidSassCompilationUtil" fork="yes" failonerror="yes">

...

  1. 
    			<arg value="com.mysql.cj.jdbc.Driver" />

...

  1. 
    			<arg value="jdbc:mysql://localhost:3306/multi_16745" />

...

  1.  <!-- The database or schema name is multi_16745 -->
    			<arg value="ctuser" />

...

  1. 
    			<arg value="canvas" />

...

  1. 
    			<arg value="/ctmodelhouse" />

...

  1. 
    			<arg value="MODELHOUSE" />

...

  1. 
    			<arg value="${WAR_ROOT}/CTRIAFramework/UIArena/theme/system/cssconfig.xml" />

...

  1. 
    			<arg value="${WAR_ROOT}" />

...

  1. 
    			<classpath refid="sasscompilecompressjars" />

...

  1. 
    		</java>

...

  1. 
    	</target>


After you perform the aforementioned steps, you can proceed with the build and deployment of your application. Anchor_GoBack_GoBack