Run script automatically after creating a new Xcode project - xcode

I've created a custom project template the needs to add a few submodules upon creation of the new project. I have the git submodule add ... command added to a .sh file. So is it possible to automatically run the script after creating the project without having to add it to the Build Phases? Maybe through the TemplateInfo.plist? If you know any alternatives or better routes to take, please let me know.
Thanks

Considering a submodule is just a reference to a fixed SHA1, you could simply add them directly to your template project.
That way, any new project would already benefit from said submodules.

Related

Laravel projects under git-versioning with same base project

I'm developing with Laravel a suite of applications which are very different from each other, but must have the same base (graphics-functions-components-login-ecc.).
I just finished the base project, which I simply called 'template', and which is under git-versioning.
Now I have to develop the real applications, which will be extensions of 'template', but I want to keep pulling the base from 'template' and create some sort of 'git extension' for each application.
I would like to do this to keep the laravel tree structure of the project (so not use external folders) while avoiding to update each single application when I modify the 'template'.
I thought about link the same project folder to two different repositories (template+extension), using 'gitignore' to manage which file links to which repository, but I think it could be troublesome in case of new file added or so.
Maybe git has already an existing way to solve this, but I'm quite new and not expert to this, so I hope you'll guide me to the light.
You can use git Submodules. Submodules are Git repositories nested inside a parent Git repository at a specific path in the parent repository’s working directory. For detail visit https://git-scm.com/docs/git-submodule.

Clone a Laravel Project

what is the best way to use an exist laravel project to create a new project.I copied my project floder and I renamed it but it does not work
Please, somebody help me!
You will still need to install the dependencies through composer as well as any node dependencies you have.
Run composer update on the new project.
Also make sure your file permissions are correct on the new project.
In my opinion the best way to do this is Version Control System.
Step 1: Create Repo of your existing project
Step 2: Fork your Repo, this will allow to choose another project name and so on
You will be able to use your first Repo as template any time when you will need without copy/paste of files on your local

TeamCity Project Template

Is there a way to have a whole project including all build configurations in a template?
We have a setup where we deploy several applications using TeamCity and the only difference in each deployment is the VCS root. The build process is the same for each of the applications.
What I have been looking for is a way to have a template for the build configuration so that new applications can easily create the TeamCity project from a template instead of the quickest way we have ATM which is the copy an existing project and change the VCS root.
Any other ideas on this, or thoughts on other ways to approach this would be welcome.
I have a similar situation, and have found that templates are the way to go. I have a template for the build, and include a parameter for the git repo. Then, in the template, add a VCS root with the address set to the parameter. Works like a charm.

How to add existing Xcode project to git version control in Xcode?

It's clear how to add an existing project to GitHub outside of Xcode, there are a number of tutorial: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
There are also a number of tutorial of how to create a new project in Xcode under version control.
However, there are no tutorial on how to do both: add an existing project with the controls within Xcode. Is this even possible? Or since I already started the project, I'll have to do it all via command line?
Since you didn't ask Xcode for a local git repository inside this project folder when you created the project, you will have to create one via the command line.
After that, you can use Xcode's internal GUI to give git commands in your project - if that's the kind of thing you really want to do (personally I abhor Xcode's git interface).

How to Gerrit Trigger builds only for a certain part of the project

I'm using Jenkins integrated with git and gerrit trigger.
I manage a huge repo that leads with a big amount of commits. So i'm not interested on running a complete build of the whole project on every push.
The idea here is just build the especific project .pom file where there is code changes.
For example:
-"common" is a subdir with its own .pom
-"persistence" is a subdir with its own .pom. "persistence" depends on common dir.
So if there is a change on persistence dir i have to build only the persistence .pom file because it will build common as a dependencie. On the other hand if someone change code on common, the jenkins do not have the necessity of building persistence. So it will save me time and hw resources.
So the question here is how could i do this? Does gerrit trigger have any support for this?
Update: On selecting the changed files does the file RegEx option refers to the file Path or the file name?
And also, is there a way to, using file RegEx field, express something like build "if changes in common and not changes in persistence"?
Have you tried to use Dynamic Trigger Configuration? you define a filter - on which change the job should start. So you create jobs for each build then define a proper gerrit trigger with filter.
Or if you want to use only 1 job for every build - then write a script where you can use git to determine which file was changed and then select the right project file for it.
Update: try to play with New build parameter: GERRIT_TOPIC
So push your changes with a proper TOPIC name e.g.
git push origin HEAD:refs/for/master/topic_name
where topic_name can be common, persistence
the topic name can be filled automatically with pre-push hook in git.

Resources