I'm trying to create a project template for Xcode from various sources and I wondered if it was possible to automatically add some Swift Package Manager dependencies ? I know it can be done with Cocoapod, but I didn't find anything regarding SPM.
Thanks.
Hope make sense
$ mkdir YourKit
$ cd YourKit
$ swift package init
Related
I installed a swift vapor web-server and I have to run some migrations. Reading from the docs(https://docs.vapor.codes/fluent/migration/?h=migrate#migrate) it says that I just have to run vapor run migrate but all I get is an error that says .unknownCommand("migrate", available: ["boot", "serve", "routes"]). It seems the vapor toolbox doesn't have the migrate command. I installed the vapor toolbox following the docs(https://docs.vapor.codes/install/linux/#install-toolbox):
git clone https://github.com/vapor/toolbox.git
cd toolbox
git checkout <desired version>
make install
To be fair i had some problems with the make install comand. It said that swiftc wasn't a valid comand but I just changed swiftc to swift inside the Makefile and it did compile at the end. As a matter of fact the vapor --version command works.
I use swift 5.5 and vapor 4. Does anybody now how to fix this or find some workaround like running the migration file by itself without the command?
I don't really use the vapor toolbox anymore. I put the second line in main.swift in the Sources/App/Run folder:
// earlier lines omitted
try configure(app)
try app.autoMigrate().wait() // <-- this one needs to be in this position
try app.run()
It needs to be after everything has been configured but before you start the app running.
I use a setup.py to declare the python libraries to include in the package of my solution.
Is there a way to check the libraries compatibility using setup.py without installing the package? Because for now I can detect the conflicts only when I try to install my package.
Thank you
I think if I were you I would try with dephell. I don't think it will be able to give you a clear answer without tweaking, but it might help you get a bit closer to the info you are looking for. For example you could try these commands:
dephell deps check --from setuppy
-- https://dephell.readthedocs.io/cmd-deps-check.html
or
dephell deps tree --from setuppy
-- https://dephell.readthedocs.io/cmd-deps-tree.html
I'm trying to learn purescript starting with the simple "Hello World" from "Purescript by Example".
Issuing a "pulp run" throws this error:
* Building project in /home/peter/devel/purescript/my-project
Error found:
at bower_components/purescript-psci-support/src/PSCI/Support.purs line 21, column 1 - line 21, column 1
Unable to parse module:
unexpected "else"
expecting declaration or end of input
purs is of version 0.11.7, Pulp is version 12.2.0.
What am I doing wrong?
Thanks for your help.
The recent release of PureScript 0.12 has introduced breaking changes. Several new package versions will not work on older compilers. If you want to stay pre-0.12, and you are using bower, then do this to your project:
Delete all contents in the bower_components directory.
Downgrade all package versions in bower.json to pre-0.12 versions, such as prelude 3.2.0, console 3.0.0, and psci-support 3.0.0. You can use Pursuit and look at older bower.json files on GitHub to figure out these versions.
Run bower install.
Run pulp build.
Alternatively, you can upgrade to 0.12 with PureScript Version Manager. At this time 0.12 is not available on npm. To do this you can follow these installation instructions but in short is:
Uninstall the old compiler: npm uninstall -g purescript.
Install PSVM: npm install -g psvm.
Download 0.12: psvm install-latest.
Install 0.12: psvm use v0.12.0
Add PSVM's bin directory to your PATH which is C:\Users\<username>\.psvm\current\bin on Windows. Make sure your current session is updated with this new PATH variable.
Test out the new compiler: purs --version.
I'm working through PureScript by Example and ran into the same issue today. I stumbled across issue 3367, where gabejohnson directs us to the blog post, Working with 0.11.7 in a 0.12 world.
Long story short, it seems like PureScript 0.12 has introduced breaking changes, just like erisco said, and we should use psc-package instead of bower if we want to stay on 0.11.7 (because pulp doesn't work with PureScript 0.12 at the moment and bower is giving the team issues with dependency management).
You can install psc-package either with the binary or using npm install -g psc-package.
After that, you will need to tell pulp to use psc-package when you init a new project using pulp --psc-package init. Finally, install the lists package with psc-package install lists.
Keep in mind that packages do not have the purescript- prefix when using psc-package, so you just pass in the package name.
This is what got me back on track and I hope this helps you too.
python-swiftclient 3.0.0
Ubuntu 16.04.1 LTS
I type in swift build and it returns the list of swift commands and says at the end no such command. Could not find anyone describing this specific command line response.
That's because you use either python-swiftclient either your PATH is wrong.
If swift --version returns:
python-swiftclient 3.0.0
Then you aren't currently calling swift build system. Check this link and update your swift release here.
Else check that you call the right swift executable by doing:
which swift
The output is the executable you are actually calling.
Environmental variable failure
just
source ~/.bashrc
Seems that the entire swift environment is needed, so visit the swift download page, and choose your system (mine is ubuntu 18.04):
$ wget https://download.swift.org/swift-5.5.2-release/ubuntu1804/swift-5.5.2-RELEASE/swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ tar -xf swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ PATH=~/swift-5.5.2-RELEASE-ubuntu18.04/usr/bin:$PATH
This solution worked perfect for me.
Swift has some ability to extract comments and documentation from a module.
Automatically generate the Swift interface for a compiled module
echo ":print_module CoreGraphics" | xcrun swift -deprecated-integrated-repl
How can I use these tools to print documentation for my own module?
Specifically, I'd like to use it in C.I. as a test of whether my modules are fully documented.
$ sudo gem install jazzy
$ jazzy
in the directory containing project file for the framework of your making per this: https://www.appcoda.com/swift-markdown/