-
-
Notifications
You must be signed in to change notification settings - Fork 197
Native source code and a Podfile without a plugin #4282
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
Native source code and a Podfile without a plugin #4282
Conversation
lib/services/cocoapods-service.ts
Outdated
if (!this.$fs.exists(pluginPodFilePath)) { | ||
public async applyPodfileToProject(moduleName: string, podfilePath: string, projectData: IProjectData, nativeProjectPath: string): Promise<void> { | ||
if (!this.$fs.exists(podfilePath)) { | ||
if (podfilePath === projectData.podfilePath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this check?
lib/services/ios-project-service.ts
Outdated
@@ -771,20 +771,27 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f | |||
this.$logger.trace(`Images to remove from xcode project: ${imagesToRemove.join(", ")}`); | |||
_.each(imagesToRemove, image => project.removeResourceFile(path.join(this.getAppResourcesDestinationDirectoryPath(projectData), image))); | |||
|
|||
await this.prepareNativeSourceCode("src", path.join(projectData.appDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, "src"), projectData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could extract some "src" constants.
New feature no longer need it: NativeScript/nativescript-cli#4282
lib/definitions/project.d.ts
Outdated
@@ -409,7 +410,7 @@ interface IPlatformProjectService extends NodeJS.EventEmitter, IPlatformProjectS | |||
getAppResourcesDestinationDirectoryPath(projectData: IProjectData): string; | |||
|
|||
cleanDeviceTempFolder(deviceIdentifier: string, projectData: IProjectData): Promise<void>; | |||
processConfigurationFilesFromAppResources(release: boolean, projectData: IProjectData): Promise<void>; | |||
processConfigurationFilesFromAppResources(release: boolean, projectData: IProjectData, installPods: boolean): Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processConfigurationFilesFromAppResources(projectData: IProjectData, opts: { release: boolean, installPods: boolean }): Promise<void>;
lib/services/cocoapods-service.ts
Outdated
|
||
if (this.$fs.exists(pluginPodfilePath) && this.$fs.exists(this.getProjectPodfilePath(projectRoot))) { | ||
if ((this.$fs.exists(podfilePath) || podfilePath === projectData.podfilePath) && this.$fs.exists(this.getProjectPodfilePath(projectRoot))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should'n we unify the behavior for plugin's pod file and pod file from App_Resources
?
lib/services/ios-project-service.ts
Outdated
@@ -771,20 +771,27 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f | |||
this.$logger.trace(`Images to remove from xcode project: ${imagesToRemove.join(", ")}`); | |||
_.each(imagesToRemove, image => project.removeResourceFile(path.join(this.getAppResourcesDestinationDirectoryPath(projectData), image))); | |||
|
|||
await this.prepareNativeSourceCode("src", path.join(projectData.appDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, "src"), projectData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case when the project has .nsconfig
file, this code will not be correct
path.join(projectData.appDirectoryPath, constants.APP_RESOURCES_FOLDER_NAME)
You should use projectData.getAppResourcesDirectoryPath()
@@ -0,0 +1,98 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not commit this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After green build
run ci |
would this work for modules too? i mean i would love to be able to drop sources directly in my module folder (platforms/ios/src for example) and have them being picked up during module build without the need to have a XCode project or a android studio project. |
@farfromrefug Yes, it works. |
@tdermendjiev awesome will try asap |
PR Checklist
What is the current behavior?
Native source code files are included to the XCode project only when they are in plugins. Podfiles as well.
What is the new behavior?
Podfile and source files added in App_Resources/iOS will be included as well.
Implements #3807 .