You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Filip Maj (Created) (JIRA)" <ji...@apache.org> on 2012/02/28 18:03:46 UTC

[jira] [Created] (CB-280) Improve layout of cordova-js scripts

Improve layout of cordova-js scripts
------------------------------------

                 Key: CB-280
                 URL: https://issues.apache.org/jira/browse/CB-280
             Project: Apache Callback
          Issue Type: Improvement
          Components: CordovaJS
    Affects Versions: 1.5.0
            Reporter: Filip Maj
            Assignee: Filip Maj
            Priority: Minor
             Fix For: 1.6.0


Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.

>From Pat's e-mail:


- rename `~/lib` to `~/cordova`; there is no more `~/lib`.
- mkdir ~/platform
- mkdir ~/platform/android
- mkdir ~/platform/...
- move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
each module exists in a path associated with it's eventual module id,
prefixed by `~/platform/[whicheverPlatform]`
- move non-modules into a 'new' `~/lib` directory; it's more than just
require.js - bootstrap, etc

Now, to do a build for a platform:
- collect as modules all files from ~/cordova
- collect as modules all files from ~/platform/[whicheverPlatform]/cordova
- collect as scripts all files from ~/lib

bonusi:

- the files are laid out exactly as the modules will be named, modulo
platform-specific prefix directories for platform-specific files; no more
in-head conversion when I'm looking at directory listings of modules.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235869#comment-13235869 ] 

Patrick Mueller commented on CB-280:
------------------------------------

Figured I'd post the script I'm using to refactor the file locations, since this will end up not appearing in the final commit.  This assumes that you've previously done a

{noformat}
mv lib lib0
{noformat}

The script recreates the {{lib}} directory, based on the contents of the old {{lib}} directory, which you've just renamed (via the command above) to {{lib0}}.

{noformat}
#!/bin/sh

#---------------------------------------------
# the only purpose of this script is to convert
# a lib/ -based cordova-js tree to the new
# lib-*/ -based one.  should not be in the
# final commit, just transient till the
# new framework is committed.
#---------------------------------------------

rm -rf lib

#---------------------------------------------
mkdir lib
mkdir lib/common

cp -R lib0/* lib/common
mv lib/common/cordova.js lib/cordova.js

echo "throw new Error('should have been replaced at build time with platform implementation')" > lib/common/exec.js
echo "throw new Error('should have been replaced at build time with platform implementation')" > lib/common/platform.js

#---------------------------------------------
mkdir -p lib/android/plugin/android
mkdir -p lib/blackberry/plugin/blackberry
mkdir -p lib/errgen/plugin/errgen
mkdir -p lib/ios/plugin/ios
mkdir -p lib/playbook/plugin/playbook
mkdir -p lib/test/plugin/test
mkdir -p lib/webworks/plugin/webworks
mkdir -p lib/wp7/plugin/wp7

#---------------------------------------------
mv lib/common/exec/android.js    lib/android/exec.js
mv lib/common/exec/blackberry.js lib/blackberry/exec.js
mv lib/common/exec/errgen.js     lib/errgen/exec.js
mv lib/common/exec/ios.js        lib/ios/exec.js
mv lib/common/exec/playbook.js   lib/playbook/exec.js
mv lib/common/exec/test.js       lib/test/exec.js
mv lib/common/exec/wp7.js        lib/wp7/exec.js

rmdir lib/common/exec

#---------------------------------------------
mv lib/common/platform/android.js    lib/android/platform.js
mv lib/common/platform/blackberry.js lib/blackberry/platform.js
mv lib/common/platform/errgen.js     lib/errgen/platform.js
mv lib/common/platform/ios.js        lib/ios/platform.js
mv lib/common/platform/playbook.js   lib/playbook/platform.js
mv lib/common/platform/wp7.js        lib/wp7/platform.js
mv lib/common/platform/common.js     lib/common/common.js

rmdir lib/common/platform

#---------------------------------------------
mv lib/common/plugin/android/*.js       lib/android/plugin/android
mv lib/common/plugin/blackberry/*.js    lib/blackberry/plugin/blackberry
mv lib/common/plugin/errgen/*.js        lib/errgen/plugin/errgen
mv lib/common/plugin/ios/*.js           lib/ios/plugin/ios
mv lib/common/plugin/playbook/*.js      lib/playbook/plugin/playbook
mv lib/common/plugin/webworks/*.js      lib/webworks/plugin/webworks
mv lib/common/plugin/wp7/*.js           lib/wp7/plugin/wp7

rmdir lib/common/plugin/android
rmdir lib/common/plugin/blackberry
rmdir lib/common/plugin/errgen
rmdir lib/common/plugin/ios
rmdir lib/common/plugin/playbook
rmdir lib/common/plugin/webworks
rmdir lib/common/plugin/wp7

#---------------------------------------------
mkdir lib/scripts
mv lib/common/bootstrap.js lib/scripts
mv lib/common/require.js   lib/scripts

mv lib/common/bootstrap/errgen.js   lib/scripts/bootstrap-errgen.js
mv lib/common/bootstrap/playbook.js lib/scripts/bootstrap-playbook.js

rm -rf lib/common/bootstrap
{noformat}
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232776#comment-13232776 ] 

Patrick Mueller commented on CB-280:
------------------------------------

I don't think there should be a problem landing this for 1.6, assuming we have some time to make this disruptive shift - keep anyone from landing patches in cordova-js for a day or so.

The only real change besides moving the files around should be the build script.  I don't anticipate any other code changes.

The "move plugins to their own directory" - like compass, etc, will involve lots of little code changes.  This may be harder to hit for 1.6.  And I'd like to do the initial re-org of the base directory as outlined here first.
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Filip Maj (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232758#comment-13232758 ] 

Filip Maj commented on CB-280:
------------------------------

I like the way this issue is shaping up. Will clean up cordova-js quite a bit.

That being said, is 1.6 too lofty a goal to land this?
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234883#comment-13234883 ] 

Patrick Mueller commented on CB-280:
------------------------------------

need to look at other changes required, like the README.md file
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232679#comment-13232679 ] 

Patrick Mueller commented on CB-280:
------------------------------------

See note in callback-dev subject: "Plan for device specific APIs?".  I mention allow the build script allow platform-specific overrides for, in this case, the notification module by blackberry.

This implies the build script will actually collect just the module names first, before writing the source, which would allow platforms to 'override' a common module, without having to write the wasted bytes out in for the never-used common module.

http://markmail.org/thread/qcf47dlzlwpakxwo
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234880#comment-13234880 ] 

Patrick Mueller commented on CB-280:
------------------------------------

initial stab in this commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=log;h=refs/heads/CB-280
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-280) Improve layout of cordova-js scripts

Posted by "Filip Maj (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234885#comment-13234885 ] 

Filip Maj commented on CB-280:
------------------------------

Sweet! I'll take a look after I'm done with my test-adding frenzy.
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-280) Improve layout of cordova-js scripts

Posted by "Patrick Mueller (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Mueller resolved CB-280.
--------------------------------

    Resolution: Fixed
      Assignee: Patrick Mueller  (was: Filip Maj)

commited to master in commit:

https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=e50b7ef686e865cc8b6bb7caa5e05292de4148a6
                
> Improve layout of cordova-js scripts
> ------------------------------------
>
>                 Key: CB-280
>                 URL: https://issues.apache.org/jira/browse/CB-280
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.5.0
>            Reporter: Filip Maj
>            Assignee: Patrick Mueller
>            Priority: Minor
>             Fix For: 1.6.0
>
>
> Originally proposed by Pat on the mailing list. Reorganize the directory names and conventions used in the builder to make the association between javascript files and modules (and their ids) clearer.
> From Pat's e-mail:
> - rename `~/lib` to `~/cordova`; there is no more `~/lib`.
> - mkdir ~/platform
> - mkdir ~/platform/android
> - mkdir ~/platform/...
> - move platform-specific stuff in ~/cordova (was ~/lib), in such a way as
> each module exists in a path associated with it's eventual module id,
> prefixed by `~/platform/[whicheverPlatform]`
> - move non-modules into a 'new' `~/lib` directory; it's more than just
> require.js - bootstrap, etc
> Now, to do a build for a platform:
> - collect as modules all files from ~/cordova
> - collect as modules all files from ~/platform/[whicheverPlatform]/cordova
> - collect as scripts all files from ~/lib
> bonusi:
> - the files are laid out exactly as the modules will be named, modulo
> platform-specific prefix directories for platform-specific files; no more
> in-head conversion when I'm looking at directory listings of modules.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira