Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Preparing for new system. * Preparing new system. * Old system working. * Fixes wrong groups created. * Fix multiple variants being created. * Tweaks to add new method to get dirname. * Remove node since we don't use it. * Extra steps. * Updates Changelog.md. * Target File Generator Fully Speced. * Configuration generator tests passing. * Context tested. * Implemented basic file reference test. * Fixes test for main group. * Tests pass. * Tests raw file. * Group. * Localized test.. * Verify tests. * Test file reference. * Preparing for group component tests.: * File reference path done. * Group tests. * Dirname tested. * All tests passing. * Fix init. * Preparing test. * Initial test. * Initial test. * Specs running. * Initial tests. * Variant group test. * All tests passing. * Enable configs.
- Loading branch information
1 parent
1a62956
commit c4ca68b
Showing
24 changed files
with
349 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,29 @@ | ||
module Xcake | ||
# This generator processes the files to add to the project from the | ||
# `include_files` and `exclude_files` | ||
# | ||
class TargetFileReferenceGenerator < Generator | ||
attr_accessor :root_node | ||
attr_accessor :dependency_provider | ||
|
||
def initialize(context) | ||
@context = context | ||
@root_node = Node.new | ||
|
||
@dependency_provider = DependencyProvider.new(FileReferenceInstaller) | ||
end | ||
|
||
def self.dependencies | ||
[TargetGenerator] | ||
end | ||
|
||
def process_files_for_target(target) | ||
native_target = @context.native_object_for(target) | ||
|
||
Dir.glob(target.include_files).each do |file| | ||
@root_node.create_children_with_path(file, native_target) | ||
end if target.include_files | ||
|
||
Dir.glob(target.exclude_files).each do |file| | ||
@root_node.remove_children_with_path(file, native_target) | ||
end if target.exclude_files | ||
end | ||
|
||
def visit_project(project) | ||
project.targets.each do |target| | ||
process_files_for_target(target) | ||
end | ||
|
||
root_node.accept(self) | ||
end | ||
def visit_target(target) | ||
# - References from Configurations | ||
# - References from Build Phases | ||
paths_to_include = Dir.glob(target.include_files) | ||
paths_to_exclude = Dir.glob(target.exclude_files) | ||
paths = paths_to_include - paths_to_exclude | ||
|
||
def visit_node(node) | ||
return unless node.path | ||
|
||
EventHooks.run_hook :before_adding_file, node | ||
|
||
installer_class = @dependency_provider.tsort.detect do |i| | ||
i.can_install_node(node) | ||
paths.each do |path| | ||
@context.file_reference_for_path(path) | ||
end | ||
|
||
unless installer_class.nil? | ||
installer = installer_class.new(context) | ||
node.accept(installer) | ||
end | ||
# - Classify Files | ||
# - Build Implicit Build Phases | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.