Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 222 lines (195 sloc) 9.925 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
<?xml version="1.0" ?>

<project name="PIE" default="build" basedir=".">

    <property name="version" value="2.0beta1-SNAPSHOT" />
    <!-- 'http://cdnjs.cloudflare.com/ajax/libs/css3pie/${version}' -->
    <property name="default_base_urls" value="['http://lojjic.github.com/PIE/files/builds/${version}']"/>
    <property name="build_dir" value="./build" />
    <property name="src_dir" value="./sources" />

    <target name="clean">
        <delete dir="${build_dir}" />
    </target>

    <target name="build-uncompressed">
        <mkdir dir="${build_dir}" />

        <concat destfile="${build_dir}/PIE_IE678_uncompressed.js">
            <fileset file="${src_dir}/js_open.js" />
            <fileset file="${src_dir}/PIE_open.js" />
            <fileset file="${src_dir}/Util.js" />
            <fileset file="${src_dir}/GradientUtil.js" />
            <fileset file="${src_dir}/Observable.js" />
            <fileset file="${src_dir}/Heartbeat.js" />
            <fileset file="${src_dir}/OnUnload.js" />
            <fileset file="${src_dir}/OnResize.js" />
            <fileset file="${src_dir}/OnScroll.js" />
            <fileset file="${src_dir}/OnPrint.js" />
            <fileset file="${src_dir}/OnMouseup.js" />
            <fileset file="${src_dir}/Length.js" />
            <fileset file="${src_dir}/BgPosition.js" />
            <fileset file="${src_dir}/BgSize.js" />
            <fileset file="${src_dir}/Angle.js" />
            <fileset file="${src_dir}/Color.js" />
            <fileset file="${src_dir}/Tokenizer.js" />
            <fileset file="${src_dir}/BoundsInfo.js" />
            <fileset file="${src_dir}/StyleInfoBase.js" />
            <fileset file="${src_dir}/BackgroundStyleInfo.js" />
            <fileset file="${src_dir}/BorderStyleInfo.js" />
            <fileset file="${src_dir}/BorderRadiusStyleInfo.js" />
            <fileset file="${src_dir}/BorderImageStyleInfo.js" />
            <fileset file="${src_dir}/BoxShadowStyleInfo.js" />
            <fileset file="${src_dir}/PaddingStyleInfo.js" />
            <fileset file="${src_dir}/VisibilityStyleInfo.js" />
            <fileset file="${src_dir}/VmlShape.js" />
            <fileset file="${src_dir}/RendererBase.js" />
            <fileset file="${src_dir}/RendererBase_IE678.js" />
            <fileset file="${src_dir}/RootRenderer.js" />
            <fileset file="${src_dir}/BackgroundRenderer.js" />
            <fileset file="${src_dir}/BorderRenderer.js" />
            <fileset file="${src_dir}/BorderImageRenderer.js" />
            <fileset file="${src_dir}/BoxShadowOutsetRenderer.js" />
            <!--<fileset file="${src_dir}/BoxShadowInsetRenderer.js" />-->
            <fileset file="${src_dir}/ImgRenderer.js" />
            <fileset file="${src_dir}/Element.js" />
            <fileset file="${src_dir}/PIE_API.js" />
            <fileset file="${src_dir}/js_close.js" />

            <filterchain>
                <tokenfilter>
                    <replacestring from="$Version$" to="${version}" />
                </tokenfilter>
            </filterchain>
        </concat>

        <concat destfile="${build_dir}/PIE_IE9_uncompressed.js">
            <fileset file="${src_dir}/js_open.js" />
            <fileset file="${src_dir}/PIE_open.js" />
            <fileset file="${src_dir}/Util.js" />
            <fileset file="${src_dir}/GradientUtil.js" />
            <fileset file="${src_dir}/Observable.js" />
            <fileset file="${src_dir}/Heartbeat.js" />
            <fileset file="${src_dir}/OnUnload.js" />
            <fileset file="${src_dir}/OnResize.js" />
            <fileset file="${src_dir}/OnScroll.js" />
            <fileset file="${src_dir}/OnMouseup.js" />
            <fileset file="${src_dir}/Length.js" />
            <fileset file="${src_dir}/BgPosition.js" />
            <fileset file="${src_dir}/BgSize.js" />
            <fileset file="${src_dir}/Angle.js" />
            <fileset file="${src_dir}/Color.js" />
            <fileset file="${src_dir}/Tokenizer.js" />
            <fileset file="${src_dir}/BoundsInfo.js" />
            <fileset file="${src_dir}/StyleInfoBase.js" />
            <fileset file="${src_dir}/BackgroundStyleInfo.js" />
            <fileset file="${src_dir}/BorderStyleInfo.js" />
            <fileset file="${src_dir}/BorderImageStyleInfo.js" />
            <fileset file="${src_dir}/PaddingStyleInfo.js" />
            <fileset file="${src_dir}/RendererBase.js" />
            <fileset file="${src_dir}/IE9RootRenderer.js" />
            <fileset file="${src_dir}/IE9BackgroundRenderer.js" />
            <fileset file="${src_dir}/IE9BorderImageRenderer.js" />
            <fileset file="${src_dir}/Element.js" />
            <fileset file="${src_dir}/PIE_API.js" />
            <fileset file="${src_dir}/js_close.js" />

            <filterchain>
                <tokenfilter>
                    <replacestring from="$Version$" to="${version}" />
                </tokenfilter>
            </filterchain>
        </concat>

        <loadfile property="htc_script_uncompressed" srcFile="${src_dir}/htc_script.js">
            <filterchain>
                <tokenfilter>
                    <replacestring from="$JSVariant$" to="_uncompressed" />
                    <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
                </tokenfilter>
            </filterchain>
        </loadfile>
        <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE_uncompressed.htc">
            <filterchain>
                <tokenfilter>
                    <replacestring from="$Version$" to="${version}" />
                    <replacestring from="$Contents$" to="${htc_script_uncompressed}" />
                </tokenfilter>
            </filterchain>
        </copy>
    </target>

    <target name="build-compressed" depends="build-uncompressed">
        <exec executable="java">
            <arg line='-jar tools/compiler.jar
--js ${build_dir}/PIE_IE678_uncompressed.js
--module "PIE_IE678:1"
--module_output_path_prefix ${build_dir}/
--compilation_level ADVANCED_OPTIMIZATIONS
--externs ${src_dir}/closure_externs.js' />
        </exec>

        <exec executable="java">
            <arg line='-jar tools/compiler.jar
--js ${build_dir}/PIE_IE9_uncompressed.js
--module "PIE_IE9:1"
--module_output_path_prefix ${build_dir}/
--compilation_level ADVANCED_OPTIMIZATIONS
--externs ${src_dir}/closure_externs.js' />
        </exec>

        <exec executable="java">
            <arg line='-jar tools/compiler.jar
--js ${src_dir}/htc_script.js
--js ${src_dir}/closure_preservefunctions.js
--module "htc_script_compressed:1"
--module "temp:1"
--module_output_path_prefix ${build_dir}/
--compilation_level ADVANCED_OPTIMIZATIONS
--externs ${src_dir}/closure_externs.js' />
        </exec>

        <loadfile property="htc_script_compressed" srcFile="${build_dir}/htc_script_compressed.js">
            <filterchain>
                <tokenfilter>
                    <replacestring from="$JSVariant$" to="" />
                    <replacestring from="$DefaultBaseUrls$" to="${default_base_urls}" />
                </tokenfilter>
            </filterchain>
        </loadfile>
        <copy file="${src_dir}/htc_markup.htc" tofile="${build_dir}/PIE.htc">
            <filterchain>
                <striplinecomments>
                    <comment value="//#" />
                </striplinecomments>
                <tokenfilter>
                    <replacestring from="$Contents$" to="${htc_script_compressed}" />
                    <replacestring from="$Version$" to="${version}" />
                </tokenfilter>
            </filterchain>
        </copy>

        <delete file="${build_dir}/temp.js" />
        <delete file="${build_dir}/htc_script_compressed.js" />
    </target>


    <target name="copy-wrappers">
        <copy todir="${build_dir}">
            <fileset dir="${src_dir}/wrappers" />
        </copy>
    </target>


    <target name="build" depends="build-uncompressed,build-compressed" />

    <target name="package" depends="clean,build,copy-wrappers">
        <!-- Create distribution bundle -->
        <zip destfile="${build_dir}/PIE.zip" basedir="${build_dir}"/>
    </target>



    <target name="deploy" depends="build" description="Builds and pushes the files to the gh-pages branch">
        <!-- Clone repo into temp dir, checking out the gh-pages branch -->
        <exec executable="git">
            <arg line="clone --reference . --branch gh-pages git@github.com:lojjic/PIE.git ${build_dir}/temp-git-clone" />
        </exec>

        <!-- Copy built files into correct version dir -->
        <copy todir="${build_dir}/temp-git-clone/files/builds/${version}" overwrite="true">
            <fileset file="${build_dir}/PIE.htc" />
            <fileset file="${build_dir}/PIE_IE678.js" />
            <fileset file="${build_dir}/PIE_IE9.js" />
            <fileset file="${build_dir}/PIE_uncompressed.htc" />
            <fileset file="${build_dir}/PIE_IE678_uncompressed.js" />
            <fileset file="${build_dir}/PIE_IE9_uncompressed.js" />
        </copy>

        <!-- Commit and push -->
        <exec executable="git" dir="${build_dir}/temp-git-clone">
            <arg line='commit -a -m "Update files for build ${version}"' />
        </exec>
        <exec executable="git" dir="${build_dir}/temp-git-clone">
            <arg line='push origin gh-pages' />
        </exec>

        <!-- Cleanup -->
        <delete dir="${build_dir}/temp-git-clone" />
    </target>

</project>
Something went wrong with that request. Please try again.