use code from library repo inserted via git subodule

0
Hello,    How is  it possible to use the code inserted via Submodule?    I have added a git Submodule with the Namespace "Logic" and want to use this code in the MainProgram.    Thanks for any hint! 
asked
1 answers
2

Hi Patrick,

 

thanks for that super question. I think it's important for all library-developer. 

 

Here my short answer: use Multi-Project workspaces. This is a simple concept which is supported by apax. 

 

In this case you have three apax.yml

root/
├── library/
│   └── apax.yml
├── app/
│   └── apax.yml
└── apax.yml

Content of root/apax.yml

type: workspace

Content of root/library/apax.yml

name: "@scope/name-of-library"
type: lib
version: 0.0.0-local

Content of root/app/apax.yml

type: app
dependencies:
  "@scope/name-of-library": 0.0.0-local
registries: # e.g.
  '@scope': 'https://npm.pkg.github.com/'

 

in this case, apax knows, that you want to use the local "liobrary-package" instead to receive it from a remote registry. 

 

the names of the folders like "library" "app" and are free selectable. The version of the library mus be like semantic-versioning (x.y.z-somethin).

 

regarding your question here's a rough workflow:

- create a folder --> insert the apax.yml with type: workspace

- create a app --> apax create app my-app

- clone the library as submodule into the workspace folder (parallel to the app) with the command e.g.: 

git submodule add git@github.com:simatic-ax/my-lib.git my-lib

 

Hope that helps

 

Regards

Juergen

answered