Skip to content

Commit

Permalink
add build, update README/LICENSE
Browse files Browse the repository at this point in the history
git-svn-id: http://dev.corsaair.com/svn/as3-universal-analytics/trunk@34 13dad66c-d88e-4d4d-a296-e493d2cc3f1e
  • Loading branch information
zwetan committed Oct 7, 2015
1 parent ae7921c commit 81eb569
Show file tree
Hide file tree
Showing 61 changed files with 26,841 additions and 207 deletions.
574 changes: 373 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
as3-universal-analytics
=======================

Google Universal Analytics for AS3 (**Flash** / **AIR** / **Redtamarin**).
Google Universal Analytics for ActionScript 3.0
(**Flash** / **AIR** / **Redtamarin**).

For few years people could use [gaforflash](https://code.google.com/p/gaforflash/)
to [track Flash content with Google Analytics](http://analytics.blogspot.fr/2008/11/want-to-track-adobe-flash-now-you-can.html),
Expand All @@ -13,6 +14,8 @@ we can offer the Flash Platform a new library which can cover more specific and
Simply put, **as3-universal-analytics** is an ActionScript 3 implementation
of the [Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/).

Please visit the [Wiki Documentation](https://github.com/zwetan/as3-universal-analytics/wiki) to get started.


Mission Statement
-----------------
Expand All @@ -24,13 +27,16 @@ Mission Statement
Status
------

The work is in progress, we will keep you posted when it is ready.
First release: [uanalytics v0.8](https://github.com/zwetan/as3-universal-analytics/releases)



We kept the project in "sleeping mode" for a couple of reasons:
LICENSE
-------

- make it work server side (eg. EVERYWHERE)
- move to Github
- code refactor
The Source Code is subject to the terms of the [Mozilla Public License](https://www.mozilla.org/en-US/MPL/), v. 2.0
or [MPL2](https://www.mozilla.org/en-US/MPL/2.0/) for short; if you have doubt or questions about this licensing
please consult the [MPL 2.0 FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/).


FAQ
Expand All @@ -51,6 +57,9 @@ A: Flash Player 11 and/or Adobe AIR 3 (October 4, 2011) and/or Redtamarin (Octob
**Q: Will it work with the Flash Player plugin as a SWF embedded in an HTTML page ?**
A: Yes.

**Q: Will it work when I test from Flash CS, Flash CC, Flash Builder, etc. ?**
A: Yes.

**Q: Will it work with AIR for mobile (iOS and Android) ?**
A: Yes.

Expand Down
11 changes: 11 additions & 0 deletions build.as3
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import redbean.*;
import shell.FileSystem;

compile( "src/uanalytics.as" );

if( FileSystem.exists( "uanalytics.abc" ) )
{
FileSystem.removeFile( "uanalytics.abc" );
}

FileSystem.move( "src/uanalytics.abc", "uanalytics.abc" );
283 changes: 283 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!--
Require min Ant 1.9.1
-->
<project name="as3-universal-analytics" default="main" basedir="."
xmlns:if="ant:if"
xmlns:unless="ant:unless" >

<target name="clean" depends="define">

<delete dir="${basedir}/${release.dir}" />
<delete dir="${basedir}/${deploy.dir}" />
<delete dir="${basedir}/${asdoc.output}" />

<mkdir dir="${basedir}/${release.dir}" />
<mkdir dir="${basedir}/${deploy.dir}" />
<mkdir dir="${basedir}/${asdoc.output}" />

</target>

<target name="define">

<!-- override -->
<property file="user.properties"/>

<!-- default -->
<property file="build/common.properties"/>

<condition property="FLEX_HOME" value="${FLEX_HOME_MAC}">
<os family="mac" />
</condition>

<condition property="FLEX_HOME" value="${FLEX_HOME_WIN}">
<os family="windows" />
</condition>

<tstamp>
<format property="TODAY" pattern="dd MMMM yyyy" />
<format property="TODAY_FILE" pattern="Y-MM-dd" />
</tstamp>

<property file="${basedir}/src/version.properties"/>
<property file="${basedir}/build/build.properties"/>

<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

</target>

<target name="before" depends="define">

<!-- debug -->
<echo message="properties:" level="verbose" />
<echo message=" FLEX_HOME = ${FLEX_HOME}" level="verbose" />
<echo message=" TODAY = ${TODAY}" level="verbose" />
<echo message=" TODAY_FILE = ${TODAY_FILE}" level="verbose" />
<echo message=" Flash version = ${local.flashplayerversion}" level="verbose" />
<echo message=" SWF version = ${local.swfversion}" level="verbose" />
<echo message="actions:" level="verbose" />
<echo message=" documentation = ${build.documentation}" level="verbose" />
<echo message="options:" level="verbose" />
<echo message=" build.nodoc = ${build.nodoc}" level="verbose" />
<echo message=" build.fatswc = ${build.fatswc}" level="verbose" />

</target>

<target name="main" depends="before,clean,compile,after">
</target>

<target name="compile">

<antcall target="compile-swc" if:true="${build.component}"/>

<antcall target="compile-abc" if:true="${build.component}"/>

<antcall target="compile-documentation" if:true="${build.documentation}"/>

<antcall target="compile-release" if:true="${build.release}"/>

</target>

<target name="compile-swc">

<sequential unless:true="${build.noswc}">

<compc
output="${basedir}/${release.dir}/${project.swc}"
target-player="${local.flashplayerversion}"
swf-version="${local.swfversion}"
>
<!-- <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> -->
<!-- <load-config filename="${basedir}/build/config.xml" append="true" /> -->
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
<namespace uri="${project.namespace}" manifest="${basedir}/${project.manifest}" />
<include-namespaces uri="${project.namespace}" />
<strict>true</strict>
<optimize>true</optimize>
<warnings>true</warnings>
<verbose-stacktraces>false</verbose-stacktraces>
<compute-digest>false</compute-digest>
<!--
<external-library-path dir="${basedir}/${project.lib-swc}/" append="true">
<include name="something.swc"/>
</external-library-path>
-->
<external-library-path dir="${FLEX_HOME}/frameworks/libs/air/" append="true">
<include name="airglobal.swc"/>
</external-library-path>
<source-path path-element="${basedir}/${project.src}" />
<!-- <include-sources dir="${basedir}/${project.src}/libraries/uanalytics" includes="**/*.as" /> -->
<include-sources dir="${basedir}/${project.src}/libraries/uanalytics/tracking" includes="**/*.as" />
<include-sources dir="${basedir}/${project.src}/libraries/uanalytics/tracker">
<include name="AppTracker.as" />
<include name="ApplicationInfo.as" />
<include name="DataSource.as" />
<include name="DefaultTracker.as" />
<include name="HitType.as" />
<include name="SessionControl.as" />
<include name="SystemInfo.as" />
<include name="TimingInfo.as" />
<include name="WebTracker.as" />
</include-sources>
<include-sources dir="${basedir}/${project.src}/libraries/uanalytics/tracker/senders">
<include name="TraceHitSender.as" />
<include name="LoaderHitSender.as" />
<include name="DebugHitSender.as" />
<include name="URLLoaderHitSender.as" />
<include name="URLStreamHitSender.as" />
</include-sources>
<include-sources dir="${basedir}/${project.src}/libraries/uanalytics/tracker/addons">
<include name="DebugSharedObjectStorage.as" />
<include name="Twitter.as" />
</include-sources>
<include-sources dir="${basedir}/${project.src}/libraries/uanalytics/utils">
<include name="crc32.as" />
<include name="generateAIRAppInfo.as" />
<include name="generateAIRSystemInfo.as" />
<include name="generateFlashSystemInfo.as" />
<include name="generateUUID.as" />
<include name="getAIRScreenColors.as" />
<include name="getAIRUserLanguage.as" />
<include name="getCurrentScreen.as" />
<include name="getDocumentEncoding.as" />
<include name="getFlashVersion.as" />
<include name="getHostname.as" />
<include name="getScreenColors.as" />
<include name="getScreenResolution.as" />
<include name="getUserLanguage.as" />
<include name="getViewportSize.as" />
<include name="isAIR.as" />
<include name="isAIR.as" />
</include-sources>
<!--
<metadata date="${TODAY}" title="${project.name}">
<publisher name="${project.publisher}" />
<creator name="${project.creator}" />
</metadata>
-->
</compc>

</sequential>

</target>

<target name="compile-abc">

<sequential unless:true="${build.noabc}">

<exec executable="redbean" dir="${basedir}" failonerror="true">

</exec>

<move file="${basedir}/${project.abc}" todir="${basedir}/${release.dir}" />

</sequential>

</target>

<target name="compile-documentation">

<sequential unless:true="${build.nodoc}">

<asdoc
output="${basedir}/${asdoc.output}"
templates-path="${basedir}/build/doc/templates/"
target-player="${local.flashplayerversion}"
swf-version="${local.swfversion}"
main-title="${asdoc.main.title}"
footer="${asdoc.footer}"
window-title="${asdoc.window.title}"
left-frameset-width="256"
keep-xml="${build.fatswc}"
skip-xsl="false"
warnings="false"
strict="false"
failonerror="true"
fork="true"
>
<verbose-stacktraces>true</verbose-stacktraces>
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<doc-sources path-element="${basedir}/${project.src}"/>
<source-path path-element="${basedir}/${project.src}" />
<external-library-path dir="${FLEX_HOME}/frameworks/libs/air/" append="true">
<include name="airglobal.swc"/>
</external-library-path>
<external-library-path dir="${basedir}/lib-swc" append="true">
<include name="redtamarin.swc"/>
</external-library-path>
<exclude-sources path-element="${basedir}/${project.src}/uanalytics.as" />
<exclude-sources path-element="${basedir}/${project.src}/UniversalAnalytics.as" />
<exclude-sources path-element="${basedir}/${project.src}/UniversalAnalytics2.as" />
<exclude-sources path-element="${basedir}/${project.src}/libraries/uanalytics/SimplestTracker.as" />
<package-description-file>${basedir}/build/doc/package.description.xml</package-description-file>
</asdoc>

<sequential if:true="${build.fatswc}">

<!-- update swc with asdoc xml -->
<zip destfile="${basedir}/${release.dir}/${project.swc}" update="true">
<zipfileset dir="${basedir}/${asdoc.output}/tempdita" prefix="docs">
<include name="*.xml" />
<include name="*.dita" />
<exclude name="ASDoc_Config.xml" />
<exclude name="overviews.xml" />
</zipfileset>
</zip>

</sequential>

<delete dir="${basedir}/${asdoc.output}/tempdita" />

</sequential>

</target>

<target name="compile-release">

<sequential unless:true="${build.nozip}">

<!-- generate documentation.zip -->
<zip destfile="${basedir}/${release.dir}/documentation.zip"
basedir="${basedir}/${asdoc.output}"
unless:true="${build.nodoc}" />

<!-- copy all files to deploy dir -->
<copy todir="${basedir}/${deploy.dir}">
<fileset dir="${basedir}">
<include name="*.txt" />
<include name="*.md" />
<include name="LICENSE" />
</fileset>
<fileset dir="${basedir}/${release.dir}">
<include name="*.swc" />
<include name="*.abc" />
</fileset>
<file file="${basedir}/${release.dir}/documentation.zip" unless:true="${build.nodoc}" />
</copy>

<!-- zip all files -->
<zip destfile="${basedir}/${deploy.dir}/${project.name}-${project.version}.zip"
basedir="${basedir}/${deploy.dir}" />

<!-- delete all files except the zip -->
<delete includeemptydirs="true">
<fileset dir="${basedir}/${deploy.dir}">
<include name="**/*"/>
<exclude name="${project.name}-${project.version}.zip"/>
</fileset>
</delete>

</sequential>

</target>


<target name="after">
</target>

</project>
24 changes: 24 additions & 0 deletions build/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

release.dir = bin-release
deploy.dir = bin-deploy
docs.dir = docs

project.name = uanalytics
project.fullname = as3-universal-analytics
project.src = src
project.lib-swc = lib-swc
project.as = ${project.name}.as
project.swc = ${project.name}.swc
project.abc = ${project.name}.abc

project.namespace = http://github.com/zwetan/as3-universal-analytics
project.manifest = build/manifest.xml
project.version = ${version.major}.${version.minor}.${version.build}

asdoc.main.title = ${project.fullname}
asdoc.window.title = ${project.fullname} v${project.version}
asdoc.footer = ${project.name} v${project.version}
asdoc.output = ${docs.dir}/uanalytics
16 changes: 16 additions & 0 deletions build/common.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FLEX_HOME_MAC = /sdk/flex/4_6
FLEX_HOME_WIN = c:/sdk/flex/4_6

local.flashplayerversion = 11
local.swfversion = 13

build.component = true
build.noswc = false
build.noabc = false

build.documentation = true
build.nodoc = false
build.fatswc = true

build.release = true
build.nozip = false
Loading

0 comments on commit 81eb569

Please sign in to comment.