init - anconaesselmann/CLSPM GitHub Wiki
The init
command generates an spmfile inside the project directory. spmfiles determine which packages get added to the project when the install command is run.
Once a package has been resolved (during install
, through dependency-cache, manually added to dependencies
file) the name of the dependency can be passed into init
.
Example:
clspm init -d FirebaseAnalytics FirebaseCrashlytics
will create an spmfile
with both dependencies if they have been resolved previously.
By default init
will create a JSON spmfile
. By passing the --csv
flag a comma-separated list can be used instead.
The path for the spmfile
to be generated can be passed is. Instead of generating the file at the project's root it will be generated at the given location. spmfile
s that are located outside of the project's root directory can be used with the install
command by providing the same --spm-file
option.
Why might you want to use this feature:
- Keeping the spmfile out of the repository
- Generating alternative spmfiles to quickly switch many dependencies to alternative ones (e.g for switching multiple inter-dependent dependencies to use local implementations or to test out updated versions of dependencies)
By default init
will generate an spmfile
without test targets. Passing in --test-targets
will create target entries for all test targets.
init
will not run if an spmfile
is already present. To replace an existing spmfile
and force the running of init
pass in --force
. To simply add dependencies call add instead.
TODO: add explanation