Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#1006 closed defect (fixed)

Dojo cannot build the intern-strings target as an Ant subproject

Reported by: [email protected] Owned by: jkuhnert
Priority: high Milestone:
Component: BuildTools Version: 0.2
Keywords: Cc:
Blocked By: Blocking:


If someone tries to build dojo as a <subant> or <ant> task of a parent Ant project, the "intern-string" target will fail due to file-not-found exceptions.

For example:

<!-- dojo build task -->
<target name="dojo" description="builds the dojo profile">
  <subant buildpath="${dojo_scripts}" target="release">
     <property name="profile" value="${dojo_profile}" />
     <property name="docless" value="true" />
  <subant buildpath="${dojo_scripts}" target="intern-strings" >
     <property name="profile" value="${dojo_profile}" />
<!-- end dojo task -->

Turns out that in Ant setting the buildpath does not actually 'cwd' to the buildpath directory. What changes is the project's basedir property (based on the various attributes that <ant> accepts).

What a change in basedir means for Jython scripts (whis is what the intern-strings target runs) is that all relative paths get broken and thus trying to build Dojo as a sub-project to a larger project fails.

The solution that I found is to use the project.resolveFile("./relative/path/").getPath() method on all relative paths within the <script> tasks.

My modified "intern-strings" target (from the 0.2.2 version of [dojo]/buildscripts/build.xml) follows:

 <!-- intern-strings task -->
    <target name="intern-strings" depends="-fix-config"
        description="pulls template paths specified in prototypes into templateStrings which can be used to speed up widget construction">
        <script language="jython"><![CDATA[
import sys
# make the python standard library avialable            

# import re
import os
from buildUtil import *

srcRoot=project.resolveFile("../").getPath() + "\"
internTemplateStrings(packageFile, srcRoot)
    <!-- end intern-strings task -->


Change History (3)

comment:1 Changed 16 years ago by dylan

Milestone: 0.4
Owner: changed from anonymous to jkuhnert

comment:2 Changed 15 years ago by jkuhnert

Resolution: fixed
Status: newclosed

Resolved in current trunk.

comment:3 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.