简体   繁体   中英

extjs, sencha build with GeoExt

I have an MVC application to build by use of

sencha app build production

In this application I use external classes (in my case GeoExt.panel.Map) and sencha command fails with the exception

com.sencha.exceptions.ExNotFound: Unknown definition for dependency : GeoExt.panel.Map

Anybody have any idea on how to fix?


content added at 21:17 04.06.2014

Please note that I have created a file named bootstrap.GeoExt.js with content to refer all sources of GeoExt:

Ext.Loader.addClassPathMappings({   
    "GeoExt": "../../../../../GeoExt/geoext2-2.0.1/src/GeoExt"
});

This file is referenced inside index.html

<!DOCTYPE HTML>
<html>
<head>    
    <meta charset="UTF-8">
    <title>TestComplete</title>
    <script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script>
    <link rel="stylesheet" href="custom.css">
    <!-- <x-compile> -->
        <!-- <x-bootstrap> -->
            <link rel="stylesheet" href="bootstrap.css">
            <script src="ext/ext-dev.js"></script>
            <script src="bootstrap.GeoExt.js"></script>
            <script src="bootstrap.js"></script>
        <!-- </x-bootstrap> -->
        <script src="app.js"></script>
    <!-- </x-compile> -->
</head>
<body></body>
</html>

This is how I included "extra" files in the packaging of my ST app

Once I was trying to build for production my ST app but I was using static json files(for prototyping purposes) and I had a data folder inside my main folder, the problem was that data folder was not being included in the packaging, I fixed it modifying build.xml (inside the main folder of your app) at the end I added:

<copy todir="${build.dir}/data/" overwrite="true">
      <fileset dir="${basedir}/data/"> //this is your main app folder 
        <include name="**/*" />
      </fileset>
</copy> 

After that my data folder was included in my production version.

Best regards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM