Code Integration - Xcode and GitLab: Difference between revisions

From blinkenwiki

No edit summary
No edit summary
Line 13: Line 13:
:* Create git repository
:* Create git repository
<li> Link the new Xcode project to the GitLab project
<li> Link the new Xcode project to the GitLab project
- git remote add origin git@gitlab.com:jimthompson/m404.git
<pre>
- get push -u origin —all
git remote add origin git@gitlab.com:jimthompson/m404.git
get push -u origin —all
</pre>
<li> Build up the Xcode project:
<li> Build up the Xcode project:
- Copy code from first sibling directory (e.g. m404-a) into Xcode directory, making new subdirectories to organize, and rename code as necessary
- Copy code from first sibling directory (e.g. m404-a) into Xcode directory, making new subdirectories to organize, and rename code as necessary

Revision as of 01:46, 13 June 2021

Check in the first local version.

  1. If more that one local copy of the codebase exists, and it’s not clear which one should be “the” version, create multiple local sibling directories.
    • Example: m404-a, m404-b, etc.
  2. Create a private project on GitLab
    • Example: m404
  3. In Xcode, create a new project with the same name.
    • Cross-platform/Empty
    • Product Name: m404
    • In same folder as m404-a, etc.
    • Create git repository
  4. Link the new Xcode project to the GitLab project
    git remote add origin git@gitlab.com:jimthompson/m404.git
    get push -u origin —all
    
  5. Build up the Xcode project: - Copy code from first sibling directory (e.g. m404-a) into Xcode directory, making new subdirectories to organize, and rename code as necessary - mkdir m404/arduino - cp m404-a/M404SD01.ino m404/arduino/m404-demo.ino - Add each new file into the Xcode project (File -> Add Files to “m404”) - Each new file should show status ‘A’ in the Xcode project navigator
  6. In Xcode: - Commit the new files. Use commit message "Initial commit for new code." - Push to the GitLab repository - Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”.
  7. Verify that the new code is visible at GitLab with the commit message used. If any other local versions exist, commit them on branches and then merge.
  8. Use Xcode to create the new branch - Source Control -> m404 — master -> new branch - m404-b
  9. Modify the code in the new branch by copying in from sibling directory - cp m404-b/M404SD01-SS.ino m404/arduino/m404-demo.ino - Commit the changes with an appropriate message: if the intent of the changes is apparent, put that in the commit message. Also put the sibling directory name in the commit message.: "Change demo code to use soft-serial. (From sibling m404-b)."
  10. Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
  11. Push the changes.
  12. Verify that the new code is visible at GitLab with the commit message used. Repeat 8-12 for other local versions.