Results 1 to 9 of 9

Thread: Managing ExtJS Within a Git Project

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    23
    Answers
    3

    Default Managing ExtJS Within a Git Project

    I am looking for best practices for an ExtJS project when using Git for source control. After some searching there seems to be a couple options, but I am struggling with the best option to make it the most convenient for our group of developers whenever we bring in a new release of ExtJS. We self-host our Git repos and are not using Architect.

    Option 1: Use Git submodules. This seems the most common, but it assumes you have an ExtJS Git repo to be used as the submodule. With no read-only access to the Git repos from Sencha to pull from, what would be the best way to bring in a new release. If we self-host an ExtJS repo it seems like a bit of a nightmare to update this repo when there is a new release from Sencha.

    Option 2: Just ignore/exclude the ExtJS dir from Git in our project. This simplifies the project repo, but it requires every developer to create a symbolic link to the correct ExtJS version dir on clone. How would you manage or track which version is required for the project? There could be multiple branches of the project that require different versions of ExtJS. How would developers know which ExtJS version they need to symbolic link too?

    Are there any other options that I am missing? I'm trying to ease the effort involved for our developers when managing multiple branches which require different versions of ExtJS and also when bringing a new release of ExtJS into the fold.

    Thanks...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Is there a reason why you don't want the ext js source in your git repo?

    Simplest is to check in everything.

    Ignoring the ext js source will make your dev copy the source directory over and hope they grab the right version and not go for the latest and greatest that others aren't using. Plus, when you switch branches, git will update the ext js source you have checked in so you can't get much easier than that.

    Submodule is fine if you want to share the same ext js repo/branch among multiple projects.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    23
    Answers
    3

    Default

    Yes, that is the simplest, but the git repo gets larger and larger every time we update the ExtJS source in the repo. The changset when updating the ExtJS code in the repo is not small. After a few ExtJS versions, cloning the repo takes a while. That is the main step I was hoping to avoid.

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Are you just renaming the directory when upgrading?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  5. #5
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    23
    Answers
    3

    Default

    We are trying to figure out the best way to bring a new version in.

    If in the new branch we remove the old ExtJS version and checkin the new under a different directory, that just makes the changeset even bigger, correct?

    What is the correct way to "merge" in a new ExtJS version from source? If the ExtJS dir is at ./extjs and it currently contains ExtJS 4.1.X and I want it to contain 4.2.X? Will Git do the right thing if I just delete ./extjs which contains 4.1.X and replace it with an ./extjs for 4.2.X? Seems there would be Git tracking issues there with files that are removed or renamed between the two versions?

  6. #6
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Of course it's going to be a huge change but can I ask what that matters? I remove the old version, commit the deletions. Then I add in the new version and commit the additions. Then I push.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  7. #7
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    23
    Answers
    3

    Default

    That's what we started doing, but after a while the git clone starts taking forever on the build server. Maybe we aren't doing something right there, but after a few ExtJS version updates doing as you mention, the repo was taking longer and longer to clone.

  8. #8
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    459
    Answers
    19

    Default

    Here's a technique I've used before. I was actually using an SCM other than git, but the concept is the same.

    Basically, I take your option 2. I exclude the Ext-JS dir from the project that goes into the SCM. However, I also include somewhere in the project that is in the SCM the zip file containing the Ext-JS distribution I want used. When the project is first imported from the SCM, I run a one-time build script that unzips the distro and copies the files I want to the proper location. A little extra work to set up, but not really hard if you know Ant or something.

    There are tradeoffs both ways. In an ideal world, having everything in the SCM as it would be deployed would be nice. However, like you I had concerns about performance working with the repo.

  9. #9
    Ext JS Premium Member
    Join Date
    Jul 2011
    Posts
    46
    Answers
    1

    Default

    You can use Ant and Ivy for this. Once you clone the repo just run specific Ant target, e.g. ant setup-project-local. Yes, you do introduce Java and Ant (or Sencha Cmd) dependency, but you might want to do much more than just getting ExtJS after cloning the repo.
    Just an example.

    conf/ivy.xml
    HTML Code:
    <ivy-module version="2.0">
        <info organisation="com.example" module="${app.name}" />
    
        <configurations defaultconf="build-conf">
            <conf name="build-conf" description="Dependencies to build the application and packages." />
            <conf name="sencha-${app.framework}-conf" description="Sencha ExtJS dependency." />
        </configurations>
    
        <dependencies>
            <!--dependency org="org.vafer" name="jdeb" rev="${jdeb.version}" conf="build-conf->default" /-->
            <dependency org="com.sencha" name="${app.framework}" rev="${app.framework.revision}" conf="sencha-${app.framework}-conf->default">
                <artifact name="${app.framework}" type="zip" />
            </dependency>
        </dependencies>
    </ivy-module>
    conf/ivysettings.xml
    HTML Code:
    <ivysettings>
        <settings defaultResolver="maven2-central-resolver" />
    
        <resolvers>
            <ibiblio name="maven2-central-resolver" m2compatible="true" usepoms="false" />
            <url name="sencha-${app.framework}-resolver">
                <artifact pattern="http://cdn.sencha.com/[module]/gpl/[artifact]-[revision]-gpl.[ext]" />
            </url>
        </resolvers>
     
        <modules>
            <module organisation="com.sencha" name="${app.framework}" resolver="sencha-${app.framework}-resolver" />
        </modules>
    </ivysettings>
    build.xml
    HTML Code:
    <target name="resolve-js-dependencies">
        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.path}" />
        <ivy:retrieve conf="sencha-${app.framework}-conf" pathId="${app.framework}-artifact.path" xmlns:ivy="antlib:org.apache.ivy.ant" />
     
        <unzip dest="${workspace.lib.dir}">
            <path refid="${app.framework}-artifact.path" />
            <patternset>
                <exclude name="${app.framework.fullname}/docs/" />
                <exclude name="${app.framework.fullname}/examples/" />
                <exclude name="${app.framework.fullname}/locale/" />
                <exclude name="${app.framework.fullname}/plugins/" />
                <exclude name="${app.framework.fullname}/resources/themes/" /><!-- TODO: This maybe required for SASS routine. -->
                <exclude name="${app.framework.fullname}/welcome/" />
                <exclude name="${app.framework.fullname}/**/*-rtl*" />
                <exclude name="${app.framework.fullname}/**/*-debug-w-comments*" />
                <exclude name="${app.framework.fullname}/*.html" />
            </patternset>
        </unzip>
        <delete quiet="true">
            <path refid="${app.framework}-artifact.path" />
        </delete>
    </target>
    
    <target name="setup-project-local" depends="resolve-js-dependencies">
        <echo>SUCCESS</echo>
        <echo>Please invoke -> sencha app refresh</echo>
    </target>
    Config
    Code:
    app.name=MyApp
    app.framework=ext
    app.framework.revision=4.2.1
    app.framework.version=${app.framework.revision}.883
    app.framework.fullname=${app.framework}-${app.framework.version}
    
    workspace.lib.dir=lib
    workspace.conf.dir=conf
    
    ivy.jar.path=${workspace.lib.dir}/ivy-2.3.0.jar
    ivy.dep.file=${workspace.conf.dir}/ivy.xml
    ivy.settings.file=${workspace.conf.dir}/ivysettings.xml

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •