Code Integration - Xcode and GitLab: Difference between revisions

From blinkenwiki

No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 18: Line 18:
</pre>
</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
<pre> 
mkdir m404/arduino
cp m404-a/M404SD01.ino m404/arduino/m404-demo.ino
</pre>
:* Add each new file into the Xcode project (File -> Add Files to “m404”)
   
   
- mkdir m404/arduino
::- Each new file should show status ‘A’ in the Xcode project navigator
- 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
<li> In Xcode:
<li> In Xcode:
- Commit the new files. Use commit message "Initial commit for new code."
:* Commit the new files. Use commit message "Initial commit for new code."
- Push to the GitLab repository
:* Push to the GitLab repository
- Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”.
::- Xcode will ask for a password - at this point, change the authentication type to “SSH Keys”.
<li> Verify that the new code is visible at GitLab with the commit message used.
<li> 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.
If any other local versions exist, commit them on branches and then merge.
<li> Use Xcode to create the new branch
<li> Use Xcode to create the new branch
- Source Control -> m404 — master -> new branch
:* Source Control -> m404 — master -> new branch
   
   
- m404-b
::- m404-b
<li> Modify the code in the new branch by copying in from sibling directory
<li> Modify the code in the new branch by copying in from sibling directory
- cp m404-b/M404SD01-SS.ino m404/arduino/m404-demo.ino
<pre>
 
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)."
</pre> 
:* 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)."
<li> Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
<li> Merge with the master branch (Source Control -> merge into branch… Choose ‘master’).
<li> Push the changes.
<li> Push the changes.
<li> Verify that the new code is visible at GitLab with the commit message used.
<li> Verify that the new code is visible at GitLab with the commit message used.
</ol>
Repeat 8-12 for other local versions.


Repeat 8-12 for other local versions.
(From Evernote)

Latest revision as of 01:50, 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.

(From Evernote)