I've checked out the RestKit repo and after a pod install in the top level folder attempting to build the tests and or the project fails. I've fixed some missing dependencies that still point to vendor but get a build fail in RKObjectMapping.h due to RKValueTransformers.h not found. What steps are needed to build the tests and the library in the workspace from the git repo?
Related
I currently need to use the nativescript-https plugin but its repository is not updated and not packed to npm and it has a couple bugs (including one with AFNetworking with version) without a solution so I've forked the repository and try to add from this forked repo using:
tns pluging add [url of the repo]
this install the plugin with no errors, but when I try to run the app it shows the following error:
NativeScript encountered a fatal error: Error: Could not find module 'nativescript-https'
So I would like to know... which is the correct workflow to do this?
Compile and add the plugin folder to your package.json using relative path.
"myplugin": "file:myplugin/dist"
Assuming myplugin is your plugin folder placed at your project root, dist is where you have your compiled JS files.
The error wasn't related to the plugin installation, the problem was that I needed to run Typescript compiler on plugin's folder to generate the .js files.
I have used godep and vendored all my dependencies in vendor/ directory. Go build is working fine as well. However how can I be sure that all my dependencies are vendored?
Is there any command that can make sure of that?
My CI service (Travis is the one I use) lets me know. Because my test build will fail if the deps aren't available.
You should be using a CI service anyway, and then you get that benefit for free.
I use govendor to manage the dependencies, which has a status option. Here's some of the commands with govendor:
init Create the "vendor" folder and the "vendor.json" file.
list List and filter existing dependencies and packages.
add Add packages from $GOPATH.
update Update packages from $GOPATH.
remove Remove packages from the vendor folder.
status Lists any packages missing, out-of-date, or modified locally.
fetch Add new or update vendor folder packages from remote repository.
sync Pull packages into vendor folder from remote repository with revisions
from vendor.json file.
migrate Move packages from a legacy tool to the vendor folder with metadata.
Specifically, you'd do govendor status to check if there are missing packages.
If you decide to use govendor, you can get started by doing:
go get github.com/kardianos/govendor
govendor migrate (which will migrate from godeps to govendor)
Also, you mentioned in a comment that your deploying to Heroky, here's some documentation from them on govendor
I keep running into the issue where I install dependencies locally, it works fine, I push to continuous integration server, and then it breaks because I forgot to godep save ./... the dependency.
How can I run the go command but require vendor imports?
Edit:
I'm using go1.6. I want the command to fail if a 3rd-party dependency does not resolve to vendor. In other words, is there a way to stop resolving dependencies in $GOPATH during tests?
I can't change the environment variable because then none of my project modules can be resolved. How can I force vendor dependencies?
There is no way to prevent builder to scan $GOPATH for packages. It seems, that you use not really good flow for manage dependencies. I recommend you to use glide for a vendoring.
Most recommended workflow:
Keep actual list of dependencies in glide.yaml.
Run glide up after any changes in glide.yaml. It will install all dependencies to vendor directory and generate glide.lock with fixed package versions. Commit glide.lock to VCS. Do not change manually glide.lock.
Do not commit vendor directory to VCS.
Run glide install on your CI or build server to install dependencies by glide.lock to vendor.
Build.
A migration from godep to glide may be done easily, because glide has a command to migrate Godeps.json to glide.yaml.
How do you work with Xcode workspaces in git? Until now, I've successfully added several projects to a workspace with each individual project having its own git. Each project then gets pushed to the remote server (github).
Works great, but the problem comes when checking out the entire workspace. I need to check out each project individually, making sure they have the same relative paths as they had on the original computer that made the push. Its tricky and prone to errors.
Is there another way?
Having faced the same problem myself, I used git submodules for the projects I wanted to add them to the main project.
Adding submodules:
$git submodule add https://github.com/chaconinc/DbConnector
$git submodule init
$git submodule update
you can update to changes on your remote server:
$git submodules update --remote
more info Here
I am unable to commit my Xcode project changes to Github due to the following error. As you can see below, it's related to Realm. I updated the pods recently. Any advice on how to fix this.
Assuming you want to commit your Pods directory to Git, which ensures that your projects can be always compiled when you checkout a certain revision without having to run pod install before, then you could reset what you have in your staging area in the Podsdirectory by running the following commands in your project directory:
git rm --cached -r Pods
git add -A Pods
(Disclaimer: You can lose data by running such commands. Please familiarize yourself with what they mean if necessary, so that you don't delete by accident what you want to commit.)
Alternatively, you can add the Pods directory to your .gitignore file. This will ensure that you can't commit the Pods directory in future, but it will be necessary that pod install is run after changes to the Podfile.lock when e.g. switching branches, collaborating and on CI.
You can achieve that by executing the following command on the shell in your project directory:
echo "/Pods" >> .gitignore
After doing that, you need to commit the changes to your .gitignore to your repository. Furthermore I'd recommend to make a dedicated commit to your repository where you remove the files under the Pods directory. This will then affect only the repositories contents and not your local checkout.
The CocoaPods Guide "Using CocoaPods" has a chapter "Should I check the Pods directory into source control?", which discusses in length the advantages and disadvantages of that:
Should I check the Pods directory into source control?
Whether or not you check in your Pods folder is up to you, as
workflows vary from project to project. We recommend that you keep the
Pods directory under source control, and don't add it to your
.gitignore. But ultimately this decision is up to you:
Benefits of checking in the Pods directory
After cloning the repo, the project can immediately build and run, even without having CocoaPods installed on the machine. There is no
need to run pod install, and no Internet connection is necessary.
The Pod artifacts (code/libraries) are always available, even if the source of a Pod (e.g. GitHub) were to go down.
The Pod artifacts are guaranteed to be identical to those in the original installation after cloning the repo.
Benefits of ignoring the Pods directory
The source control repo will be smaller and take up less space.
As long as the sources (e.g. GitHub) for all Pods are available, CocoaPods is generally able to recreate the same installation.
(Technically there is no guarantee that running pod install will
fetch and recreate identical artifacts when not using a commit SHA in
the Podfile. This is especially true when using zip files in the
Podfile.)
There won't be any conflicts to deal with when performing source control operations, such as merging branches with different Pod
versions.
Whether or not you check in the Pods directory, the Podfile and
Podfile.lock should always be kept under version control.
In addition, you might want to check, whether your .gitignore can be improved. I can recognize from the screenshots for example that you have a xcuserdata directory in your Xcode project, which Git doesn't ignore. Those are user-specific configuration files and don't necessarily belong into a repository. If you collaborate with others, ignoring those reduces the size of the repo and the noise in pull requests and makes change sets easier to review. But as above it is ultimately up to you, whether you want to check them in or not. GitHub hosts a crowd-sourced repository with file templates for a wide variety of languages. Their Objective-C file might be good starting point for you.