From a35a86e45079a1031ed33ccefb4171986f032f17 Mon Sep 17 00:00:00 2001 From: onevcat Date: Fri, 30 Aug 2019 11:02:06 +0900 Subject: [PATCH] Update file copying script to adapt SPM support --- .../package.xcworkspace/contents.xcworkspacedata | 7 +++++++ APNGKit.xcodeproj/project.pbxproj | 2 +- sync-libpng-apng | 12 +++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/APNGKit.xcodeproj/project.pbxproj b/APNGKit.xcodeproj/project.pbxproj index 55b879a..4a4c073 100644 --- a/APNGKit.xcodeproj/project.pbxproj +++ b/APNGKit.xcodeproj/project.pbxproj @@ -692,7 +692,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "ruby ./sync-libpng-apng"; + shellScript = "ruby ./sync-libpng-apng\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/sync-libpng-apng b/sync-libpng-apng index e905940..f986426 100755 --- a/sync-libpng-apng +++ b/sync-libpng-apng @@ -4,9 +4,15 @@ require 'fileutils' exit unless File.directory?("./libpng-apng/") && Dir.entries('./libpng-apng/').include?("png.c") -files = ["png.c", "png.h", "pngconf.h", "pngdebug.h", "pngerror.c", "pngget.c", "pnginfo.h", "pngmem.c", "pngpread.c", "pngpriv.h", "pngread.c", "pngrio.c", "pngrtran.c", "pngrutil.c", "pngset.c", "pngstruct.h", "pngtrans.c", "pngwio.c", "pngwrite.c", "pngwtran.c", "pngwutil.c", "arm/filter_neon_intrinsics.c", "arm/filter_neon.S", "arm/arm_init.c"] +files = ["png.c", "pngdebug.h", "pngerror.c", "pngget.c", "pnginfo.h", "pngmem.c", "pngpread.c", "pngpriv.h", "pngread.c", "pngrio.c", "pngrtran.c", "pngrutil.c", "pngset.c", "pngstruct.h", "pngtrans.c", "pngwio.c", "pngwrite.c", "pngwtran.c", "pngwutil.c", "arm/filter_neon_intrinsics.c", "arm/filter_neon.S", "arm/arm_init.c"] +files.map! { |file| "./libpng-apng/" + file} -files.map! {|file| "./libpng-apng/" + file} +include_files = ["pngconf.h", "png.h"] +include_files.map! { |file| "./libpng-apng/" + file} + +FileUtils.mkdir_p './APNGKit/libpng-apng/include' FileUtils.cp files, './APNGKit/libpng-apng' -FileUtils.cp './libpng-apng/scripts/pnglibconf.h.prebuilt', './APNGKit/libpng-apng/pnglibconf.h' +FileUtils.cp include_files, './APNGKit/libpng-apng/include' + +FileUtils.cp './libpng-apng/scripts/pnglibconf.h.prebuilt', './APNGKit/libpng-apng/include/pnglibconf.h'