8000 Extract project creation and preparation into new object by sebastianv1 · Pull Request #8243 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extract project creation and preparation into new object #8243

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

Merged

Conversation

sebastianv1
Copy link
Collaborator
@sebastianv1 sebastianv1 commented Nov 2, 2018

The object ProjectGenerator is now repsonsible for creating a new Pod::Project and preparing it's structure from the build configurations, platforms, and pod targets.

@sebastianv1 sebastianv1 force-pushed the sebastanv1/extract-project-generator branch from 726db29 to 63487df Compare November 2, 2018 20:50
@CocoaPodsBarista
Copy link
CocoaPodsBarista commented Nov 2, 2018
1 Warning
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.

Here's an example of your CHANGELOG entry:

* Extract project creation and preparation into new object  
  [sebastianv1](https://github.com/sebastianv1)
  [#issue_number](https://github.com/CocoaPods/CocoaPods/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

Copy link
Member
@amorde amorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

object_version = @aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min
project_generator = ProjectGenerator.new(@sandbox, project_path, @pod_targets, build_configurations,
platforms, object_version, @config.podfile_path)
@project = project_generator.generate!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the project need to be stored in the generator if its included in the generation result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. No it doesn't.

@sebastianv1 sebastianv1 force-pushed the sebastanv1/extract-project-generator branch 2 times, most recently from c692722 to 72e0ba1 Compare November 2, 2018 21:17
@sebastianv1 sebastianv1 changed the title Extract project creation and preparation into new project. Extract project creation and preparation into new object Nov 2, 2018
@sebastianv1 sebastianv1 force-pushed the sebastanv1/extract-project-generator branch from 72e0ba1 to bc8da6b Compare November 2, 2018 21:34
@@ -59,7 +60,15 @@ def initialize(sandbox, aggregate_targets, pod_targets, analysis_result, install
end

def generate!
project = prepare
project_path = sandbox.project_path
build_configurations = @analysis_result.all_user_build_configurations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont have to use the ivars here at all. You can remove the @ for most of these

#
attr_reader :sandbox

# @return [#to_s] path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was it [#to_s] before? Can be String?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah String is probably better

#
def generate!
project = create_project(@path, @object_version)
prepare(@sandbox, project, @pod_targets, @build_configurations, @platforms, @podfile_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here you can use sandbox and pod_targets etc no ivar

Copy link
Member
@segiddins segiddins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, other than using methods instead of ivar access

@dnkoutso dnkoutso added this to the 1.7.0 milestone Nov 6, 2018
@sebastianv1 sebastianv1 force-pushed the sebastanv1/extract-project-generator branch 3 times, most recently from 83d16e0 to 05783d3 Compare November 6, 2018 19:23
The object `ProjectGenerator` is repsonsible for creating a new `Pod::Project` and preparing it's structure from the build configurations, platforms, and pod targets.
@sebastianv1 sebastianv1 force-pushed the sebastanv1/extract-project-generator branch from 05783d3 to 51cc044 Compare November 6, 2018 19:41
@dnkoutso dnkoutso merged commit 230787c into CocoaPods:master Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
53CC
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0