Skip to content

Project id does not match directory name if it contains a dash #413

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

Closed
brianchirls opened this issue Apr 6, 2015 · 3 comments
Closed

Project id does not match directory name if it contains a dash #413

brianchirls opened this issue Apr 6, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@brianchirls
Copy link

See NativeScript/ios-jsc#77

To reproduce, run tns create hello-world.

The project is created in a folder called hello-world, but the project id inside .tnsproject is org.nativescript.helloworld. Project ids inside other files (e.g. AndroidManifest.xml, build.xml) are inconsistent - some have the dash, and some don't.

@teobugslayer
Copy link
Contributor

Hello @brianchirls ,
we generate ids so that they are valid in all supported platforms (including windows, which we plan to support). Can you pinpoint where we generate incorrect ids?

@brianchirls
Copy link
Author

Hi @teobugslayer. I don't know where in the code the name gets replaced, but I'm pretty sure it happens at project creation, not any time later. It appears it's validated here.

If some platforms can't handle a dash in the name, then names containing one should be rejected by the validator.

@Fatme
Copy link
Contributor

Fatme commented Apr 27, 2015

Hello @brianchirls,

Sorry for the late response.

You're right that the project id is inconsistent. As @teobugslayer said we generate cross platform identifier and sanitize the given or default (the default id is org.nativescript.<app name>) app identifier. But we doesn't sanitize the app name. And actually here we get the inconsistent.

In your case we're creating a folder named hello-world, AndroidManifest.xml is replaced with the sanitized application identifier e.g org.nativescript.helloworld. After that android update project -p <project directory> is called and creates build.xml with org.nativescript.hello-world.

I'm going to fix the problem and will update you here in this thread.

@Fatme Fatme self-assigned this Apr 27, 2015
Fatme pushed a commit to telerik/mobile-cli-lib that referenced this issue Apr 27, 2015
Fatme pushed a commit that referenced this issue Apr 27, 2015
Fatme pushed a commit that referenced this issue Apr 27, 2015
Fatme pushed a commit that referenced this issue Apr 28, 2015
Fatme pushed a commit that referenced this issue May 4, 2015
Fatme pushed a commit to telerik/mobile-cli-lib that referenced this issue May 4, 2015
Fatme pushed a commit that referenced this issue May 4, 2015
@teobugslayer teobugslayer added this to the 1.0.1 milestone May 4, 2015
Fatme pushed a commit to telerik/mobile-cli-lib that referenced this issue May 5, 2015
Fatme pushed a commit that referenced this issue May 5, 2015
#413

Conflicts:
	lib/common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants