Dactyloidae iOS initial commit

This commit is contained in:
wuggy 2026-06-26 21:04:09 -07:00
commit 7154a0497e
2123 changed files with 197052 additions and 0 deletions

View file

@ -0,0 +1 @@
gems/

View file

@ -0,0 +1,4 @@
source 'https://rubygems.org'
gem 'cocoapods', '~> 1.1.0'
gem 'minitest'

View file

@ -0,0 +1,74 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.3)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
claide (1.0.1)
cocoapods (1.1.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.1, < 2.0)
cocoapods-core (= 1.1.1)
cocoapods-deintegrate (>= 1.0.1, < 2.0)
cocoapods-downloader (>= 1.1.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.1.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.1)
nap (~> 1.0)
xcodeproj (>= 1.3.3, < 2.0)
cocoapods-core (1.1.1)
activesupport (>= 4.0.2, < 5)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.1.1)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (1.1.0)
colored (1.2)
escape (0.0.4)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.2)
i18n (0.7.0)
json (1.8.3)
minitest (5.9.1)
molinillo (0.5.4)
nanaimo (0.2.2)
nap (1.1.0)
netrc (0.7.8)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
xcodeproj (1.4.1)
CFPropertyList (~> 2.3.3)
activesupport (>= 3)
claide (>= 1.0.1, < 2.0)
colored (~> 1.2)
nanaimo (~> 0.2.0)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (~> 1.1.0)
minitest
BUNDLED WITH
1.13.3

View file

@ -0,0 +1,13 @@
test: install repo_update
@set -e; \
for test in *_test.rb; do \
bundle exec ./$$test; \
done
repo_update:
@bundle exec pod repo update --silent
install:
@bundle install --path gems
.PHONY: test install

View file

@ -0,0 +1,43 @@
#!/usr/bin/env ruby
require 'minitest/autorun'
require_relative 'test_running_validator'
class IntegrationTest < Minitest::Test
def test_validate_project
assert validator.validate, "validation failed: #{validator.failure_reason}"
end
private
def validator
@validator ||= TestRunningValidator.new(podspec, []).tap do |validator|
validator.test_files = Dir["#{project_test_dir}/**/*.swift"]
validator.test_resources = Dir["#{project_test_dir}/fixtures"]
validator.config.verbose = true
validator.no_clean = true
validator.use_frameworks = true
validator.fail_fast = true
validator.local = true
validator.allow_warnings = true
subspec = ENV['VALIDATOR_SUBSPEC']
if subspec == 'none'
validator.no_subspecs = true
else
validator.only_subspec = subspec
end
if ENV['IOS_SIMULATOR']
validator.ios_simulator = ENV['IOS_SIMULATOR']
end
end
end
def podspec
File.expand_path(File.dirname(__FILE__) + '/../../SQLite.swift.podspec')
end
def project_test_dir
File.expand_path(File.dirname(__FILE__) + '/../SQLiteTests')
end
end

View file

@ -0,0 +1,120 @@
require 'cocoapods'
require 'cocoapods/validator'
require 'fileutils'
class TestRunningValidator < Pod::Validator
APP_TARGET = 'App'
TEST_TARGET = 'Tests'
attr_accessor :test_files
attr_accessor :test_resources
attr_accessor :ios_simulator
attr_accessor :tvos_simulator
attr_accessor :watchos_simulator
def initialize(spec_or_path, source_urls)
super(spec_or_path, source_urls)
self.test_files = []
self.test_resources = []
self.ios_simulator = :oldest
self.tvos_simulator = :oldest
self.watchos_simulator = :oldest
end
def create_app_project
super
project = Xcodeproj::Project.open(validation_dir + "#{APP_TARGET}.xcodeproj")
create_test_target(project)
project.save
end
def add_app_project_import
super
project = Xcodeproj::Project.open(validation_dir + 'App.xcodeproj')
group = project.new_group(TEST_TARGET)
test_target = project.targets.last
test_target.add_resources(test_resources.map { |resource| group.new_file(resource) })
test_target.add_file_references(test_files.map { |file| group.new_file(file) })
add_swift_version(test_target)
project.save
end
def install_pod
super
if local?
FileUtils.ln_s file.dirname, validation_dir + "Pods/#{spec.name}"
end
end
def podfile_from_spec(*args)
super(*args).tap do |pod_file|
add_test_target(pod_file)
end
end
def build_pod
super
Pod::UI.message "\Testing with xcodebuild.\n".yellow do
run_tests
end
end
private
def create_test_target(project)
test_target = project.new_target(:unit_test_bundle, TEST_TARGET, consumer.platform_name, deployment_target)
create_test_scheme(project, test_target)
end
def create_test_scheme(project, test_target)
project.recreate_user_schemes
test_scheme = Xcodeproj::XCScheme.new(test_scheme_path(project))
test_scheme.add_test_target(test_target)
test_scheme.save!
end
def test_scheme_path(project)
Xcodeproj::XCScheme.user_data_dir(project.path) + "#{TEST_TARGET}.xcscheme"
end
def add_test_target(pod_file)
app_target = pod_file.target_definitions[APP_TARGET]
Pod::Podfile::TargetDefinition.new(TEST_TARGET, app_target)
end
def run_tests
command = [
'clean', 'build', 'build-for-testing', 'test-without-building',
'-workspace', File.join(validation_dir, "#{APP_TARGET}.xcworkspace"),
'-scheme', TEST_TARGET,
'-configuration', 'Debug'
]
case consumer.platform_name
when :ios
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
command += Fourflusher::SimControl.new.destination(ios_simulator, 'iOS', deployment_target)
when :osx
command += %w(LD_RUNPATH_SEARCH_PATHS=@loader_path/../Frameworks)
when :tvos
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
command += Fourflusher::SimControl.new.destination(tvos_simulator, 'tvOS', deployment_target)
when :watchos
# there's no XCTest on watchOS (https://openradar.appspot.com/21760513)
return
else
return
end
output, status = _xcodebuild(command)
unless status.success?
message = 'Returned an unsuccessful exit code.'
if config.verbose?
message += "\nXcode output: \n#{output}\n"
else
message += ' You can use `--verbose` for more information.'
end
error('xcodebuild', message)
end
output
end
end