Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: More control over what the .xcodeproj is named #2107

Open
joeskeen opened this issue Oct 7, 2016 · 3 comments · May be fixed by #5801 or NativeScript/NativeScript#10525
Open

Feature Request: More control over what the .xcodeproj is named #2107

joeskeen opened this issue Oct 7, 2016 · 3 comments · May be fixed by #5801 or NativeScript/NativeScript#10525

Comments

@joeskeen
Copy link

joeskeen commented Oct 7, 2016

Currently the projectName value that is passed into the platform template is set here:
https://github.com/NativeScript/nativescript-cli/blob/master/lib/project-data.ts#L101

this.projectName = this.$projectHelper.sanitizeName(path.basename(projectDir));

So if your NativeScript app is under ~/projects/my-project, the iOS project will end up being named myproject.xcodeproj, and the resulting app package will be named myproject.ipa. If you check this project into source control and a team member clones it into ~/git/project-app, when they build the project their iOS project will be named projectapp.xcodeproj, and the resulting app package will be named projectapp.ipa. Since the project name is always based on the directory containing the NativeScript app, there is no way to predict what the output file will be named, unless you put the root of your app in a subdirectory of your repository.

Why is this a problem? I have been trying to get continuous integration builds working with Bamboo within our enterprise. The way that Bamboo works is it has a unique certain key based on the project, plan, and job that it generates, and that is the name of the folder that it clones the project into during builds. Because of this, it is proving to be difficult to predict the name of the artifact that will be generated from the build. Actually I don't even get that far, since, it is difficult to predict the name of the XCode project I need to hand off to FastLane to do all of our enterprise build and deployment tasks.

Ideally, instead of using the name of the directory containing the NativeScript project, instead we could sanitize the name of the project as specified in package.json, or even a custom property in that file under nativescript (I noticed you already have an id field there to specify the bundle identifier). If such a field doesn't exist, you could fall back on using the directory name, but that would at least give a way to name your project and IPA file and have a predictable build artifact.

@TheBrousse
Copy link

+1

@rosen-vladimirov
Copy link
Contributor

Hey @joeskeen ,
Currently you can use the --copyTo flag of CLI's build/run commands. This flag allows you to set a name/location of the built .ipa/.apk file. For example:

$ tns build ios --for-device --copyTo ./myIpa.ipa

This will produce ipa file called myIpa.ipa in your current working directory.
Do you think this solves your issue?

@joeskeen
Copy link
Author

@rosen-vladimirov thanks for getting back about this. I've changed jobs a couple times since writing up this feature request, and I'm now too far removed from the situation to fully address it, but I think that the --copyTo flag may not completely solve the issue described. When using FastLane to do the enterprise build steps, it was an .xcodeproj file it was using, rather than an .ipa file. As I am assuming that the --copyTo flag is an after-the-fact thing, I don't think it would help too much.

@TheBrousse @stephenfeather as you both gave a 👍 to this, do you have anything you would like to add?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CLI Team
  
Inbox
4 participants