Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2806] Android: module api: assets/ folder contents not being included.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M05
ComponentsAndroid
Labelsandroid, defect, release-1.6.0, reported-1.5.1
ReporterBill Dawson
AssigneeMarshall Culpepper
Created2011-04-15T03:30:00.000+0000
Updated2011-04-17T02:00:08.000+0000

Description

Reproduce:

  • Create a new module or use an existing one.
  • Put a file such as a PNG in the assets/ folder below the module root.
  • Build the project using ant.
  • In the dist folder, use jar tf [jarfile] and unzip -l [zipfile] to confirm that the asset file was not put anywhere.

Comments

  1. Bill Dawson 2011-04-15

    Marshall,

    Have a look at this diff:

       diff --git a/support/module/android/build.xml b/support/module/android/build.xml
       index 3e51233..dd46c51 100644
       --- a/support/module/android/build.xml
       +++ b/support/module/android/build.xml
       @@ -71,7 +71,10 @@
           <target name="dist" depends="compile" description="Generate a distributable module JAR">
               <ti.string property="module.id" string="${manifest.moduleid}" tolowercase="true"/>
               <property name="module.jar" location="${dist}/${ant.project.name}.jar"/>
       -       <jar destfile="${module.jar}" basedir="${classes}"/>
       +       <jar destfile="${module.jar}">
       +           <fileset dir="${classes}"/>
       +           <fileset dir="${ti.module.root}" includes="assets/**" excludes="assets/README"/>
       +       </jar>
               <property name="zip.prefix" value="modules/android/${module.id}/${manifest.version}"/>
               
               <zip destfile="${dist}/${module.id}-android-${manifest.version}.zip">
       

    (Pretty version: https://skitch.com/billdawson/rjnfb/timobile-bash-125x25)">https://skitch.com/billdawson/rjnfb/timobile-bash-125x25).

    I didn't want to commit anything without checking with you. This change achieves just what I wanted: the ability to use getClass().getClassLoader().getResourceAsStream("assets/xxxx.png");, but I'm not sure if that's the way you intended the assets/ folder to be used.

    Thx,
    Bill

  2. Bill Dawson 2011-04-15

    Putting this in 1.6 since it's a pretty big deal, but haven't assigned a milestone for it -- I'll let marshall/don choose.

  3. Marshall Culpepper 2011-04-15

    Hey Bill.. this looks right, feel free to push it

  4. Bill Dawson 2011-04-15

    (from [70ff1a5d3829e972fe137db914821e0cec4f348d]) [#2806 state:fixed-in-qa] patch module build.xml to include assets folder contents https://github.com/appcelerator/titanium_mobile/commit/70ff1a5d3829e972fe137db914821e0cec4f348d"> https://github.com/appcelerator/titanium_mobile/commit/70ff1a5d3829...

  5. Bill Dawson 2011-04-15

    (from [71e5697df121928e2d3ebe5934ee503236a3ced9]) [#2806 state:fixed-in-qa] patch module build.xml to include assets folder contents https://github.com/appcelerator/titanium_mobile/commit/71e5697df121928e2d3ebe5934ee503236a3ced9"> https://github.com/appcelerator/titanium_mobile/commit/71e5697df121...

  6. Marshall Culpepper 2011-04-15

    verified assets bundling works with new and existing module projects

JSON Source