Template:Obtaining The Source Code: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
Ivand (talk | contribs)
 
(60 intermediate revisions by 10 users not shown)
Line 1: Line 1:
=== Current (0.80.3) ===
=== Tarballs ===
'''(For playing Spring online)'''
'''(For playing online official games on lobby.springrts.com - the spring lobby server)'''


'''[http://spring.clan-sy.com/dl/spring_0.80.3_src.tar.lzma <span style="color:#bbf;">Source .tar.lzma (aka 7z)</span>]'''
{{Tarballs}}


'''[http://spring.clan-sy.com/dl/spring_0.80.3_src.tar.gz <span style="color:#bbf;">Source .tar.gz</span>]'''
=== Git ===
[https://github.com/spring/spring Spring project page at github]


This code is the same as that used to build the last public release. If you want to play online on the main server, use this or desyncs will occur.
Master repo URI: <code>{{GitCloneUrl}}</code><br/>
Backup repo: <code>git://git.code.sf.net/p/springrts/code</code>


<!--=== Release candidate (0.80.1) ===
Branches of interest:
'''(For testing purposes)'''
* master - latest stable, enforced for official games on lobby.springrts.com
* maintenance - fixes for the latest stable
* develop - major developments (most active, larger developments)


'''[http://spring.clan-sy.com/dl/spring_0.80.1_src.tar.lzma <span style="color:#bbf;">Source .tar.lzma (aka 7z)</span>]'''
Assuming the GIT command line client is installed, you can clone (get locally) the repository with the commands below.


'''[http://spring.clan-sy.com/dl/spring_0.80.1_src.tar.gz <span style="color:#bbf;">Source .tar.gz</span>]'''-->
====Latest Stable (master branch, useless for development purposes, lives as maintenance moving forward)====
<pre>git clone --recursive git://github.com/spring/spring.git -b master</pre>
To later update it (get the changes other people did) with:
<pre>git pull --rebase</pre>


=== Development Sources from Git ===
====Maintenance (maintenance branch)====
'''(Bleeding-edge, unstable code for Development and Testing)'''
<pre>git clone --recursive git://github.com/spring/spring.git -b maintenance</pre>


'''[http://github.com/spring/spring/tree/master <span style="color:#bbf;">Spring project page at github</span>]'''
====Bleeding-edge (develop branch)====
<pre>git clone --recursive git://github.com/spring/spring.git -b develop</pre>


Git clone URL for the master repo: '''git://github.com/spring/spring.git'''
====Working with git====
Please note that patches to the code must be done for either develop or maintenance. Such patches can be then sent to one of the developers with repository access. If you are new to git and github, you may want to have a look at [http://help.github.com/ this guide] to get you started.


For serious developers. This will also allow you to make a patch out of the changes you make to the code, and send it to one of the developers with repository access.
Note: you can switch <code>branches</code> this way:{{code|
# (optional) backup your current code changes
git stash


Assuming the GIT-commandline client is installed, you can clone the repository with
# switch branch
git checkout $MY_OTHER_BRANCH


<code>git clone git://github.com/spring/spring.git</code>
# sometimes needed
# note, it deletes all your unstashed changes and all non-pushed commits on the new branch,
# but it doesn't delete untracked files.
#git reset --hard


and  update it with
# update/sync with remote repo
git pull --rebase


<code>git pull</code>
# (optional) if you want to apply the code changes backed-up in the first step
#git stash pop # reapplies your changes and DELETES the backup
# or
#git stash apply --index 0  # reapplies your changes and keep the backup (see `git stash list`)
}}


If github is unavailable or slow, there is a mirror (updated twice a day):
====Submodules====
'''git://springrts.com/spring'''
To obtain the submodules you should clone the repository with --recursive as mentioned above.
If you haven't done this, you can execute the following code
{{code|
git submodule sync
git submodule update --init
}}
 
To update the submodules, you have to execute the same commands again or pull normally.

Latest revision as of 17:24, 6 May 2020

Tarballs

(For playing online official games on lobby.springrts.com - the spring lobby server)

Using Git is the recommended way to get the sources of the engine. In spite of, you can use the official tarballs to compile Spring without git.

Note: Do NOT use the zip-files from github, they are missing important data to compile Spring.

See Building spring for build instructions.

Git

Spring project page at github

Master repo URI: git://github.com/spring/spring.git
Backup repo: git://git.code.sf.net/p/springrts/code

Branches of interest:

  • master - latest stable, enforced for official games on lobby.springrts.com
  • maintenance - fixes for the latest stable
  • develop - major developments (most active, larger developments)

Assuming the GIT command line client is installed, you can clone (get locally) the repository with the commands below.

Latest Stable (master branch, useless for development purposes, lives as maintenance moving forward)

git clone --recursive git://github.com/spring/spring.git -b master

To later update it (get the changes other people did) with:

git pull --rebase

Maintenance (maintenance branch)

git clone --recursive git://github.com/spring/spring.git -b maintenance

Bleeding-edge (develop branch)

git clone --recursive git://github.com/spring/spring.git -b develop

Working with git

Please note that patches to the code must be done for either develop or maintenance. Such patches can be then sent to one of the developers with repository access. If you are new to git and github, you may want to have a look at this guide to get you started.

Note: you can switch branches this way:<syntaxhighlight lang="bash">

  1. (optional) backup your current code changes

git stash

  1. switch branch

git checkout $MY_OTHER_BRANCH

  1. sometimes needed
  2. note, it deletes all your unstashed changes and all non-pushed commits on the new branch,
  3. but it doesn't delete untracked files.
  4. git reset --hard
  1. update/sync with remote repo

git pull --rebase

  1. (optional) if you want to apply the code changes backed-up in the first step
  2. git stash pop # reapplies your changes and DELETES the backup
  3. or
  4. git stash apply --index 0 # reapplies your changes and keep the backup (see `git stash list`)

</syntaxhighlight>

Submodules

To obtain the submodules you should clone the repository with --recursive as mentioned above. If you haven't done this, you can execute the following code <syntaxhighlight lang="bash"> git submodule sync git submodule update --init

</syntaxhighlight>

To update the submodules, you have to execute the same commands again or pull normally.