<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="Air Native Extension Build Scripts" default="all">

    <!-- Config -->
    <property file="build.config"/>

    <!-- All -->
    <target name="all" depends="ios,android,swc,package" description="Full build of extension"/>

    <!-- iOS -->
    <target name="ios" description="Build iOS Library">
        <mkdir dir="../temp/ios/build/"/>

        <exec executable="xcodebuild" failonerror="true" dir="../ios/">
            <arg line="-project ${name}.xcodeproj"/>
            <arg line="-alltargets clean"/>
        </exec>

        <exec executable="xcodebuild" failonerror="true" dir="../ios/">
            <arg line="-project ${name}.xcodeproj"/>
            <arg line="-sdk ${ios.sdkversion}"/>
            <arg line="-alltargets"/>
            <arg line="-configuration Release"/>
            <arg line="SYMROOT=../temp/ios/build/"/>
        </exec>

        <copy file="../temp/ios/build/Release-iphoneos/lib${name}.a" todir="../temp/ios" overwrite="true"/>

        <delete dir="../temp/ios/build/"/>
    </target>

    <!-- Android -->
    <target name="android" description="Build Android Library">
        <delete dir="../android/temp"/>
        <mkdir dir="../android/temp/classes"/>

        <javac srcdir="../android/src" destdir="../android/temp/classes" includeantruntime="false">
            <classpath>
                <pathelement location="${android.sdk}/android.jar"/>
                <pathelement location="${flex.sdk}/lib/android/FlashRuntimeExtensions.jar"/>
                <pathelement location="${gplayservices.libs}/libs/google-play-services.jar"/>
            </classpath>
        </javac>

        <mkdir dir="../android/temp/zip"/>
        <unzip src="${gplayservices.libs}/libs/google-play-services.jar" dest="../android/temp/zip" />
        <copydir src="../android/temp/zip/com" dest="../android/temp/classes/com"/>

        <copy todir="../temp/android/res/">
            <fileset dir="${gplayservices.libs}/bin/res"/>
        </copy>
        
        <copy todir="../temp/android/res/values/">
            <fileset dir="${gplayservices.libs}/res/values"/>
        </copy>

        <mkdir dir="../temp/android/"/>
        <jar basedir="../android/temp/classes" destfile="../temp/android/lib${name}.jar"/>
        <delete dir="../android/temp"/>
    </target>

    <!-- Actionscript -->
    <target name="swc" description="Build SWC library">
        <mkdir dir="../temp/swc/content/"/>

        <fileset dir="../actionscript/src" casesensitive="yes" id="classfiles">
            <include name="**/*.as"/>
        </fileset>

        <pathconvert property="classlist" refid="classfiles" pathsep=" " dirsep=".">
            <regexpmapper from=".*src.(.*)\.as" to="\1"/>
        </pathconvert>

        <exec executable="${flex.sdk}/bin/compc${bin.ext}" failonerror="true">
            <arg line='-source-path ../actionscript/src'/><commit_msg>updated build script<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="Air Native Extension Build Scripts" default="all">

    <!-- Config -->
    <property file="build.config"/>

    <!-- All -->
    <target name="all" depends="ios,android,swc,package" description="Full build of extension"/>

    <!-- iOS -->
    <target name="ios" description="Build iOS Library">
        <mkdir dir="../temp/ios/build/"/>

        <exec executable="xcodebuild" failonerror="true" dir="../ios/">
            <arg line="-project ${name}.xcodeproj"/>
            <arg line="-alltargets clean"/>
        </exec>

        <exec executable="xcodebuild" failonerror="true" dir="../ios/">
            <arg line="-project ${name}.xcodeproj"/>
            <arg line="-sdk ${ios.sdkversion}"/>
            <arg line="-alltargets"/>
            <arg line="-configuration Release"/>
            <arg line="SYMROOT=../temp/ios/build/"/>
        </exec>

        <copy file="../temp/ios/build/Release-iphoneos/lib${name}.a" todir="../temp/ios" overwrite="true"/>

        <delete dir="../temp/ios/build/"/>
    </target>

    <!-- Android -->
    <target name="android" description="Build Android Library">
        <delete dir="../android/temp"/>
        <mkdir dir="../android/temp/classes"/>

        <javac srcdir="../android/src" destdir="../android/temp/classes" includeantruntime="false">
            <classpath>
                <pathelement location="${android.sdk}/android.jar"/>
                <pathelement location="${flex.sdk}/lib/android/FlashRuntimeExtensions.jar"/>
                <pathelement location="${gplayservices.libs}/libs/google-play-services.jar"/>
            </classpath>
        </javac>

        <!-- compile GPS -->
        <mkdir dir="../android/temp/zip"/>
        <unzip src="${gplayservices.libs}/libs/google-play-services.jar" dest="../android/temp/zip" />
        <copydir src="../android/temp/zip/com" dest="../android/temp/classes/com"/>

        <!-- <copy todir="../temp/android/res/">
            <fileset dir="${gplayservices.libs}/bin/res/crunch"/>
        </copy>
        
        <copy todir="../temp/android/res/values/">
            <fileset dir="${gplayservices.libs}/res/values"/>
        </copy> -->

        <!-- <exec executable="rm" dir="../temp/android/">
            <arg line="-fR $(find . -type d -name crunch|xargs) "/>
        </exec> -->
        <!-- END compile GPS -->

        <mkdir dir="../temp/android/"/>
        <jar basedir="../android/temp/classes" destfile="../temp/android/lib${name}.jar"/>
        <delete dir="../android/temp"/>
    </target>

    <!-- Actionscript -->
    <target name="swc" description="Build SWC library">
        <mkdir dir="../temp/swc/content/"/>

        <fileset dir="../actionscript/src" casesensitive="yes" id="classfiles">
            <include name="**/*.as"/>
        </fileset>

        <pathconvert property="classlist" refid="classfiles" pathsep=" " dirsep=".">
            <regexpmapper from=".*src.(.*)\.as" to="\1"/>
        </pathconvert>

        <exec executable="${flex.sdk}/bin/compc${bin.ext}" failonerror="true">
            <arg line='-source-path ../actionscript/src'/>
{'fraction_non_alphanumeric': 0.2105177200718602, 'fraction_numerical': 0.0013065490772497142, 'mean_word_length': 2.226554267650158, 'pattern_counts': {'":': 0, '<': 126, '<?xml version=': 2, '>': 126, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3462014', 'n_tokens_mistral': 1803, 'n_tokens_neox': 1720, 'n_words': 305}