├── .gitignore ├── .markdownlint.json ├── .tm_properties ├── .troubleshooting ├── .gitignore ├── CrossCompile │ ├── CrossCompile.rb │ └── Hello.swift ├── Tests │ └── swift-build.rb ├── Troubleshooter.rb ├── dispatch │ ├── block.cpp.rb │ └── libswiftDispatch.so.rb ├── foundation │ ├── LIBC_PRIVATE.rb │ └── __BEGIN_DECLS.rb ├── llb │ └── stdarg.h.rb ├── stdlib │ ├── glibc.swiftmodule.rb │ └── libswiftRemoteMirror.rb └── swift │ ├── Array.cpp.rb │ ├── BackDeployment.cpp.rb │ ├── Casting.cpp.rb │ ├── DarwinLink.rb │ ├── Glibc.o.rb │ ├── Immediate.cpp.rb │ ├── Invalid_Abbref_for_Record.rb │ ├── MetadataSource.cpp.rb │ └── SwiftRT-ELF.cpp.rb ├── .unused ├── Builders │ ├── CMarkBuilder.rb │ ├── CurlBuilder.rb │ ├── DispatchBuilder.rb │ ├── FoundationBuilder.rb │ ├── ICUBaseBuilder.rb │ ├── ICUBuilder.rb │ ├── ICUHostBuilder.rb │ ├── ICUSwiftHostBuilder.rb │ ├── LLBBuilder.rb │ ├── LLVMBuilder.rb │ ├── OpenSSLBuilder.rb │ ├── SPMBuilder.rb │ ├── SwiftBuilder.rb │ ├── SwiftSPMBuilder.rb │ └── XMLBuilder.rb ├── Shell │ ├── bootstrap.sh │ ├── brew.sh │ ├── environment.sh │ └── verify.sh ├── Vagrantfile ├── android-destination.json └── swiftc-arm-linux-androideabi ├── .vscode ├── settings.json └── tasks.json ├── Assets ├── Readme.md ├── android-copy-libs ├── android-swift-build ├── android-swiftc ├── copy-libs-aarch64-linux-android ├── copy-libs-arm-linux-androideabi ├── copy-libs-i686-linux-android ├── copy-libs-x86_64-linux-android ├── swift-build-aarch64-linux-android ├── swift-build-arm-linux-androideabi ├── swift-build-i686-linux-android ├── swift-build-x86_64-linux-android ├── swiftc-aarch64-linux-android ├── swiftc-arm-linux-androideabi ├── swiftc-i686-linux-android └── swiftc-x86_64-linux-android ├── Automation.js ├── CHANGELOG.md ├── LICENSE.txt ├── Media └── irpin.jpg ├── NDK_VERSION ├── Patches ├── icu │ └── source │ │ ├── config │ │ └── mh-linux.diff │ │ ├── configure.diff │ │ └── data │ │ └── Makefile.in.diff ├── llbuild │ └── CMakeLists.txt.diff ├── spm │ └── Sources │ │ ├── Build │ │ ├── BuildPlan.swift.diff │ │ └── CMakeLists.txt.diff │ │ ├── Commands │ │ └── CMakeLists.txt.diff │ │ ├── LLBuildManifest │ │ └── CMakeLists.txt.diff │ │ ├── PackageGraph │ │ └── CMakeLists.txt.diff │ │ ├── PackageLoading │ │ └── CMakeLists.txt.diff │ │ ├── PackageModel │ │ └── CMakeLists.txt.diff │ │ ├── SPMBuildCore │ │ └── CMakeLists.txt.diff │ │ ├── SPMLLBuild │ │ └── CMakeLists.txt.diff │ │ ├── SourceControl │ │ └── CMakeLists.txt.diff │ │ ├── Workspace │ │ └── CMakeLists.txt.diff │ │ ├── XCBuildSupport │ │ └── CMakeLists.txt.diff │ │ ├── Xcodeproj │ │ └── CMakeLists.txt.diff │ │ ├── swift-build │ │ └── CMakeLists.txt.diff │ │ ├── swift-package │ │ └── CMakeLists.txt.diff │ │ ├── swift-run │ │ └── CMakeLists.txt.diff │ │ └── swift-test │ │ └── CMakeLists.txt.diff ├── swift-corelibs-foundation │ ├── CMakeLists.txt.diff │ ├── CoreFoundation │ │ ├── Base.subproj │ │ │ └── SwiftRuntime │ │ │ │ └── CoreFoundation.h.diff │ │ └── CMakeLists.txt.diff │ ├── Foundation │ │ └── CMakeLists.txt.diff │ └── Sources │ │ ├── CMakeLists.txt.diff │ │ └── Foundation │ │ └── Process.swift.diff ├── swift-corelibs-libdispatch │ ├── CMakeLists.txt.diff │ ├── cmake │ │ └── modules │ │ │ └── DispatchCompilerWarnings.cmake.diff │ └── src │ │ └── swift │ │ └── CMakeLists.txt.diff ├── swift-tools-support-core │ └── Sources │ │ ├── TSCBasic │ │ └── CMakeLists.txt.diff │ │ ├── TSCLibc │ │ └── CMakeLists.txt.diff │ │ └── TSCUtility │ │ └── CMakeLists.txt.diff └── swift │ ├── cmake │ └── modules │ │ ├── Libdispatch.cmake.diff │ │ └── SwiftConfigureSDK.cmake.diff │ └── stdlib │ ├── cmake │ └── modules │ │ └── AddSwiftStdlib.cmake.diff │ └── private │ └── CMakeLists.txt.diff ├── RELEASING.md ├── Readme.md ├── Tests ├── ADB.js ├── ProjectBuilder.js ├── TestAutomation.js ├── main.js ├── sample-exe │ ├── .gitignore │ ├── Builder.js │ └── Sources │ │ └── main.swift ├── sample-lib │ ├── .gitignore │ ├── Builder.js │ └── Sources │ │ ├── HelloMessage.swift │ │ └── main.swift └── sample-pkg │ ├── .gitignore │ ├── Builder.js │ ├── Package.swift │ └── Sources │ ├── CLib │ ├── Example.c │ ├── Example.h │ └── include │ │ └── Clib.h │ ├── CStdLib │ ├── FILE.c │ └── include │ │ └── CStdLib.h │ ├── CppLib │ ├── CppToC.cpp │ ├── CppToC.h │ ├── MyClass.cpp │ ├── MyClass.hpp │ └── include │ │ └── CppLib.h │ ├── Exe │ ├── SAConcurrencyConsumer.swift │ └── main.swift │ ├── Lib │ ├── CLibConsumer.swift │ ├── CppLibConsumer.swift │ └── HelloMessage.swift │ ├── SAConcurrency │ └── SAConcurrencyMain.swift │ └── StdLib │ └── FILE.swift ├── VERSION ├── lib ├── Archs.js ├── Archs │ ├── Arch.js │ ├── Arm64Arch.js │ ├── ArmArch.js │ ├── HostArch.js │ ├── x86Arch.js │ └── x86_64Arch.js ├── Builder.js ├── Builders │ ├── CMarkBuilder.js │ ├── CURLBuilder.js │ ├── DispatchBuilder.js │ ├── FoundationBuilder.js │ ├── ICUBaseBuilder.js │ ├── ICUBuilder.js │ ├── ICUHostBuilder.js │ ├── LLBBuilder.js │ ├── LLVMBuilder.js │ ├── SAPBuilder.js │ ├── SPMBuilder.js │ ├── SSLBuilder.js │ ├── SwiftBuilder.js │ ├── SwiftCryptoBuilder.js │ ├── SwiftDriverBuilder.js │ ├── SwiftStdLibBuilder.js │ ├── SwiftTSCBuilder.js │ ├── XMLBuilder.js │ └── YAMSBuilder.js ├── Components.js ├── Components │ ├── CMarkComponent.js │ ├── CURLComponent.js │ ├── Component.js │ ├── DispatchComponent.js │ ├── FoundationComponent.js │ ├── ICUCompoment.js │ ├── LLBComponent.js │ ├── LLVMComponent.js │ ├── SAPComponent.js │ ├── SPMComponent.js │ ├── SSLComponent.js │ ├── SwiftComponent.js │ ├── SwiftCryptoComponent.js │ ├── SwiftDriverComponent.js │ ├── SwiftStdLibComponent.js │ ├── SwiftTSCComponent.js │ ├── XMLComponent.js │ └── YAMSComponent.js ├── Config.js ├── Folder.js ├── Git │ ├── Checkout.js │ ├── Repo.js │ └── Revision.js ├── Installer.js ├── Location.js ├── NDK.js ├── Paths.js ├── Settings.js └── Tool.js └── main.js /.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant 2 | /*.log 3 | .DS_Store 4 | /.idea 5 | 6 | /ToolChain 7 | /local.properties.yml 8 | /local.properties.json 9 | /*.code-workspace 10 | /.favorites.json 11 | /*.bbprojectd 12 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD022": false, 3 | "MD024": false, 4 | "MD032": false, 5 | "MD004": false, 6 | "MD013": false 7 | } 8 | -------------------------------------------------------------------------------- /.tm_properties: -------------------------------------------------------------------------------- 1 | excludeInFolderSearch = "{$excludeInFolderSearch,ToolChain/Build,ToolChain/Install}" -------------------------------------------------------------------------------- /.troubleshooting/.gitignore: -------------------------------------------------------------------------------- 1 | /Build -------------------------------------------------------------------------------- /.troubleshooting/CrossCompile/Hello.swift: -------------------------------------------------------------------------------- 1 | print("X") 2 | -------------------------------------------------------------------------------- /.troubleshooting/Tests/swift-build.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../Troubleshooter.rb" 4 | 5 | class Builder < Troubleshooter 6 | def initialize() 7 | super(File.expand_path(File.dirname(__FILE__))) 8 | 9 | @cmd = <` into `/Sources/swift/stdlib/public/SwiftShims/Visibility.h` 40 | # ******* 41 | # Uncommenting this block cause compile issues 42 | "-I#{@ndk}/sources/cxx-stl/llvm-libc++/include" 43 | # ******* 44 | 45 | "-I#{@ndk}/sources/cxx-stl/llvm-libc++abi/include" 46 | "-I#{@ndk}/sources/android/support/include" 47 | "-I#{@ndk}/sysroot/usr/include" 48 | "-I#{@ndk}/sysroot/usr/include/arm-linux-androideabi" 49 | 50 | -isystem #{@sources}/icu/icu4c/source/common 51 | -isystem #{@sources}/icu/icu4c/source/i18n 52 | -MD -MT stdlib/public/runtime/CMakeFiles/swiftImageRegistrationObjectELF-android-armv7.dir/SwiftRT-ELF.cpp.o 53 | -MF stdlib/public/runtime/CMakeFiles/swiftImageRegistrationObjectELF-android-armv7.dir/SwiftRT-ELF.cpp.o.d 54 | -o stdlib/public/runtime/CMakeFiles/swiftImageRegistrationObjectELF-android-armv7.dir/SwiftRT-ELF.cpp.o 55 | -c #{@sources}/swift/stdlib/public/runtime/SwiftRT-ELF.cpp 56 | EOM 57 | end 58 | end 59 | 60 | Builder.new().build() 61 | -------------------------------------------------------------------------------- /.unused/Builders/CMarkBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "../Common/Builder.rb" 26 | 27 | class CMarkBuilder < Builder 28 | 29 | def initialize() 30 | super(Lib.cmark, Arch.host) 31 | end 32 | 33 | def executeConfigure 34 | # See: $SWIFT_REPO/docs/WindowsBuild.md 35 | cmd = [] 36 | cmd << "cd #{@builds} &&" 37 | cmd << "cmake -G Ninja" 38 | cmd << "-DCMAKE_INSTALL_PREFIX=/" 39 | cmd << "-DCMAKE_BUILD_TYPE=Release" 40 | cmd << "-DCMARK_TESTS=false" 41 | if isMacOS? 42 | cFlags = '-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' 43 | cmd << "-DCMAKE_C_FLAGS='#{cFlags}'" 44 | cmd << "-DCMAKE_CXX_FLAGS='#{cFlags}'" 45 | cmd << "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9" 46 | cmd << "-DCMAKE_OSX_SYSROOT=#{macOSSDK}" 47 | end 48 | cmd << @sources 49 | execute cmd.join(" ") 50 | end 51 | 52 | def executeBuild 53 | execute "cd #{@builds} && ninja" 54 | end 55 | 56 | def executeInstall 57 | execute "DESTDIR=#{@installs} cmake --build #{@builds} --target install" 58 | end 59 | 60 | end 61 | -------------------------------------------------------------------------------- /.unused/Builders/ICUBaseBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "../Common/Builder.rb" 26 | 27 | class ICUBaseBuilder < Builder 28 | 29 | def initialize(component, arch) 30 | super(component, arch) 31 | @sources = "#{Config.sources}/#{Lib.icu}/icu4c" 32 | end 33 | 34 | def applyRenamingFix 35 | file = "#{@installs}/include/unicode/uconfig.h" 36 | message "Applying changes to #{file} (As suggected by ICU)." 37 | prependContents = File.read("#{@builds}/uconfig.h.prepend") 38 | contents = File.read(file) 39 | token = "#define __UCONFIG_H__" 40 | contents = contents.sub(token, "#{token}\n#{prependContents}") 41 | File.write(file, contents) 42 | end 43 | 44 | end 45 | -------------------------------------------------------------------------------- /.unused/Builders/ICUHostBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "ICUBaseBuilder.rb" 26 | 27 | class ICUHostBuilder < ICUBaseBuilder 28 | 29 | def initialize() 30 | super(Lib.icu, Arch.host) 31 | end 32 | 33 | def executeConfigure 34 | hostSystem = isMacOS? ? "MacOSX" : "Linux" 35 | cmd = ["cd #{@builds} &&"] 36 | cmd << "CFLAGS='-Os'" 37 | cmd << "CXXFLAGS='--std=c++11'" 38 | cmd << "#{@sources}/source/runConfigureICU #{hostSystem} --prefix=#{@installs}" 39 | 40 | # Below option should not be set. Otherwize you will have ICU without embed data. 41 | # See: 42 | # - ICU Data - ICU User Guide: http://userguide.icu-project.org/icudata#TOC-Building-and-Linking-against-ICU-data 43 | # - https://forums.swift.org/t/partial-nightlies-for-android-sdk/25909/43?u=v.gorlov 44 | # cmd << "--enable-tools=no" 45 | 46 | cmd << "--enable-static --enable-shared=no --enable-extras=no --enable-strict=no --enable-icuio=no --enable-layout=no" 47 | cmd << "--enable-layoutex=no --enable-tests=no --enable-samples=no --enable-dyload=no" 48 | execute cmd.join(" ") 49 | end 50 | 51 | def executeBuild 52 | execute "cd #{@builds} && make" 53 | end 54 | 55 | def executeInstall 56 | puts "ICU Host Build not require to install. It is just used for `Cross Compilation`." 57 | end 58 | 59 | end 60 | -------------------------------------------------------------------------------- /.unused/Builders/ICUSwiftHostBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "ICUBaseBuilder.rb" 26 | 27 | class ICUSwiftHostBuilder < ICUBaseBuilder 28 | 29 | def initialize() 30 | super(Lib.icuSwift, Arch.host) 31 | end 32 | 33 | def executeConfigure 34 | # See: ./Sources/swift/utils/build-script-impl 35 | hostSystem = isMacOS? ? "MacOSX" : "Linux" 36 | cmd = ["cd #{@builds} &&"] 37 | cmd << "CFLAGS='-Os'" 38 | cmd << "CXXFLAGS='--std=c++11 -fPIC'" 39 | cmd << "#{@sources}/source/runConfigureICU #{hostSystem} --prefix=#{@installs}" 40 | 41 | # Below option should not be set. Otherwize you will have ICU without embed data. 42 | # See: 43 | # - ICU Data - ICU User Guide: http://userguide.icu-project.org/icudata#TOC-Building-and-Linking-against-ICU-data 44 | # - https://forums.swift.org/t/partial-nightlies-for-android-sdk/25909/43?u=v.gorlov 45 | # cmd << --enable-tools=no" 46 | 47 | cmd << "--enable-renaming --with-library-suffix=swift" # These options can cause a trouble. If not working look how other ICU builders are configured. 48 | cmd << "--enable-shared --enable-strict --disable-icuio --disable-plugins --disable-dyload" 49 | cmd << "--disable-extras --disable-samples --enable-tests=no --disable-layoutex --with-data-packaging=library" 50 | execute cmd.join(" ") 51 | end 52 | 53 | def executeBuild 54 | execute "cd #{@builds} && make" 55 | end 56 | 57 | def executeInstall 58 | execute "cd #{@builds} && make install" 59 | applyRenamingFix() 60 | end 61 | 62 | end 63 | -------------------------------------------------------------------------------- /.unused/Builders/LLBBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "../Common/Builder.rb" 26 | 27 | class LLBBuilder < Builder 28 | 29 | def initialize() 30 | super(Lib.llb, Arch.host) 31 | @swift = SwiftSPMBuilder.new() 32 | end 33 | 34 | def executeConfigure 35 | # See: $SWIFT_REPO/docs/WindowsBuild.md 36 | cmd = [] 37 | cmd << "cd #{@builds} &&" 38 | cmd << "cmake -G Ninja" 39 | cmd << "-DCMAKE_INSTALL_PREFIX=/" 40 | cmd << "-DCMAKE_BUILD_TYPE=Release" 41 | cmd << "-DLLBUILD_SUPPORT_BINDINGS=Swift" 42 | cmd << "-DSWIFTC_EXECUTABLE=\"#{@swift.builds}/bin/swiftc\"" 43 | cmd << @sources 44 | execute cmd.join(" ") 45 | end 46 | 47 | def executeBuild 48 | execute "cd #{@builds} && ninja" 49 | end 50 | 51 | def executeInstall 52 | execute "DESTDIR=#{@installs} cmake --build #{@builds} --target install" 53 | end 54 | 55 | end 56 | -------------------------------------------------------------------------------- /.unused/Builders/LLVMBuilder.rb: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License 3 | # 4 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | 25 | require_relative "../Common/Builder.rb" 26 | 27 | # See: 28 | # - https://stackoverflow.com/questions/40122657/build-llvm-clang4-0-for-android-armeabi 29 | # - LLVM Getting Started: https://llvm.org/docs/GettingStarted.html#requirements 30 | # - CLANG Getting Started: http://clang.llvm.org/get_started.html 31 | # - Building LLVM with CMake — LLVM 9 documentation: https://llvm.org/docs/CMake.html 32 | 33 | class LLVMBuilder < Builder 34 | 35 | def initialize() 36 | super(Lib.llvm, Arch.host) 37 | end 38 | 39 | def executeConfigure 40 | setupSymLinks(true) 41 | cFlags = "-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector" 42 | cmd = <>~/.bashrc 8 | eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) 9 | brew --version 10 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 11 | brew install cmake ninja 12 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 13 | -------------------------------------------------------------------------------- /.unused/Shell/environment.sh: -------------------------------------------------------------------------------- 1 | export RUBYOPT=-W0 2 | export AUTOMATION_IS_INSIDE_VAGRANT_BOX=1 3 | -------------------------------------------------------------------------------- /.unused/Shell/verify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Verify ruby 4 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 5 | echo "Verifying versions" 6 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 7 | echo "Ruby:" 8 | ruby --version 9 | echo "CMake:" 10 | cmake --version 11 | echo "Ninja:" 12 | ninja --version 13 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 14 | echo "Ubuntu version" 15 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 16 | lsb_release -irc 17 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 18 | echo "Synched folder Contents" 19 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 20 | ls -l /vagrant 21 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 22 | echo "Done!" 23 | -------------------------------------------------------------------------------- /.unused/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | rootDirPath = File.dirname(__FILE__) 5 | propertiesFilePath = File.join(rootDirPath, "local.properties.yml") 6 | if !File.exist?(propertiesFilePath) 7 | raise "\n File \"#{propertiesFilePath}\" is not exists.\n Please follow instructions from \"#{rootDirPath}/Readme.md\" file." 8 | end 9 | 10 | settingKey = "ndk.dir.linux-vagrant" 11 | ndkPath = File.readlines(propertiesFilePath).select { |line| line.start_with?(settingKey) }.first 12 | if ndkPath.nil? 13 | raise "\n File \"#{propertiesFilePath}\" don't have setting key \"#{settingKey}\".\n Please follow instructions from \"#{rootDirPath}/Readme.md\" file." 14 | end 15 | 16 | ndkPath = File.expand_path(ndkPath.sub("#{settingKey}:", "").strip()) 17 | 18 | # See: 19 | # - https://github.com/readdle/swift-android-toolchain/blob/master/vagrant/Vagrantfile 20 | Vagrant.configure("2") do |config| 21 | 22 | # Using default unsecured Vagrant SSH key dor development. 23 | config.ssh.insert_key = false 24 | 25 | # This network will be used to access server from Host machine. 26 | config.vm.network 'private_network', ip: '192.168.10.200' 27 | 28 | config.vm.synced_folder ndkPath, '/android-ndk' 29 | 30 | config.vm.box = "ubuntu/bionic64" 31 | config.vm.provision :shell, path: "Scripts/Shell/bootstrap.sh" 32 | config.vm.provision :shell, inline: "echo 'source /vagrant/Scripts/Shell/environment.sh' > /etc/profile.d/sa-environment.sh", :run => 'always' 33 | config.vm.provision :shell, path: "Scripts/Shell/brew.sh", privileged: false 34 | config.vm.provision :shell, path: "Scripts/Shell/verify.sh", privileged: false 35 | 36 | config.vm.provider "virtualbox" do |vb| 37 | vb.memory = "5120" # Setting value less that `5120` can cause linker to fail. 38 | vb.cpus = `sysctl -n hw.physicalcpu`.to_i # use all available 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /.unused/android-destination.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "sdk": "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain", 4 | "toolchain-bin-dir": "/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin", 5 | "target": "armv7-none-linux-androideabi", 6 | "dynamic-library-extension": "so", 7 | "extra-cc-flags": [ 8 | "-v", 9 | "-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include", 10 | "-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi" 11 | ], 12 | "extra-swiftc-flags": [ 13 | "-v", 14 | "-tools-directory", 15 | "/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin", 16 | "-Xcc", 17 | "-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include", 18 | "-Xcc", 19 | "-I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi", 20 | "-Xclang-linker", 21 | "--sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm", 22 | "-Xclang-linker", 23 | "--gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64", 24 | "-L", 25 | "/usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a", 26 | "-L", 27 | "/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x", 28 | "-L", 29 | "/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24", 30 | "-L", 31 | "/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7" 32 | ], 33 | "extra-cpp-flags": [ 34 | "-v" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /.unused/swiftc-arm-linux-androideabi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run this script by `SWIFT_EXEC=/Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/.unused/swiftc-arm-linux-androideabi swift build -c release -Xswiftc -sdk -Xswiftc /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain` 4 | 5 | /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/bin/swiftc \ 6 | -v -Xcc -v \ 7 | -target armv7-none-linux-androideabi \ 8 | -tools-directory /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin \ 9 | -Xclang-linker --sysroot=/usr/local/ndk/20.1.5948944/platforms/android-24/arch-arm \ 10 | -Xclang-linker --gcc-toolchain=/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64 \ 11 | -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include \ 12 | -Xcc -I/usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi \ 13 | -L /usr/local/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \ 14 | -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x \ 15 | -L /usr/local/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 \ 16 | -L /Volumes/Shared/Git/MyProjects/swift-everywhere-toolchain/ToolChain/swift-android-toolchain/usr/lib/swift/android/armv7 \ 17 | $@ 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "cSpell.enabled": true, 4 | "cSpell.words": [ 5 | "Toolchain", 6 | "cmake", 7 | "libc" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /Assets/Readme.md: -------------------------------------------------------------------------------- 1 | # swift-everywhere-toolchain 2 | 3 | ## Requirements 4 | 5 | - macOS 11.x 6 | 7 | ## Usage 8 | 9 | 1. Make sure that symbolic link with name `/usr/local/ndk/21.4.7075529` points to right `Android NDK` location (usually `~/Library/Android/sdk/ndk/21.4.7075529`). Create symbolic link if needed. 10 | 11 | ```bash 12 | sudo mkdir -p /usr/local/ndk 13 | sudo ln -vsi ~/Library/Android/sdk/ndk/21.4.7075529 /usr/local/ndk/21.4.7075529 14 | ``` 15 | 16 | 2. Compile Swift sources for `armv7a`, `aarch64`, `x86` or `x86_64` architectures: 17 | 18 | ```bash 19 | # Compile executable for armv7a architecture. 20 | $ToolChain/usr/bin/swiftc-arm-linux-androideabi -emit-executable -o hello main.swift 21 | 22 | # Copy dependencies (so-files) for armv7a architecture to [destination] directory. 23 | $ToolChain/usr/bin/copy-libs-arm-linux-androideabi -output [destination] 24 | ``` 25 | 26 | 3. Or build Swift package: 27 | 28 | ```bash 29 | cd /Path/To/Your/Swift/Package 30 | 31 | # Build for armv7a architecture. 32 | $ToolChain/usr/bin/swift-build-arm-linux-androideabi 33 | 34 | # Build and pass additional build options. 35 | $ToolChain/usr/bin/swift-build-arm-linux-androideabi -v -Xcc -D__ANDROID_API__=24 36 | 37 | # To see available build options. 38 | $ToolChain/usr/bin/swift-build-arm-linux-androideabi --help 39 | 40 | # Copy dependencies (so-files) for armv7a architecture to [destination] directory. 41 | $ToolChain/usr/bin/copy-libs-arm-linux-androideabi -output [destination] 42 | ``` 43 | -------------------------------------------------------------------------------- /Assets/copy-libs-aarch64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-copy-libs -target aarch64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/copy-libs-arm-linux-androideabi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-copy-libs -target armv7-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/copy-libs-i686-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-copy-libs -target i686-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/copy-libs-x86_64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-copy-libs -target x86_64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swift-build-aarch64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swift-build -target aarch64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swift-build-arm-linux-androideabi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swift-build -target armv7-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swift-build-i686-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swift-build -target i686-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swift-build-x86_64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swift-build -target x86_64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swiftc-aarch64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swiftc -target aarch64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swiftc-arm-linux-androideabi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swiftc -target armv7-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swiftc-i686-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swiftc -target i686-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /Assets/swiftc-x86_64-linux-android: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # The MIT License 4 | # 5 | # Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | # 25 | 26 | `dirname $0`/android-swiftc -target x86_64-unknown-linux-android "$@" 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Media/irpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vgorloff/swift-everywhere-toolchain/c3a1cb918f741daa8a49675c1f18e02593108316/Media/irpin.jpg -------------------------------------------------------------------------------- /NDK_VERSION: -------------------------------------------------------------------------------- 1 | 21.4.7075529 2 | -------------------------------------------------------------------------------- /Patches/icu/source/config/mh-linux.diff: -------------------------------------------------------------------------------- 1 | diff --git a/icu4c/source/config/mh-linux b/icu4c/source/config/mh-linux 2 | index 53d6780d68..ee19d7d943 100644 3 | --- a/icu4c/source/config/mh-linux 4 | +++ b/icu4c/source/config/mh-linux 5 | @@ -27,7 +27,7 @@ LDFLAGSICUDT=-nodefaultlibs -nostdlib 6 | 7 | ## Compiler switch to embed a library name 8 | # The initial tab in the next line is to prevent icu-config from reading it. 9 | - LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) 10 | + LD_SONAME = -Wl,-soname -Wl,$(notdir $(SO_TARGET)) 11 | #SH# # We can't depend on MIDDLE_SO_TARGET being set. 12 | #SH# LD_SONAME= 13 | 14 | -------------------------------------------------------------------------------- /Patches/icu/source/configure.diff: -------------------------------------------------------------------------------- 1 | --- /Users/vova/Downloads/configure 2018-10-02 00:39:56.000000000 +0200 2 | +++ /Users/vova/Downloads/configure-new 2018-11-30 22:54:31.000000000 +0100 3 | @@ -7763,15 +7763,18 @@ 4 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5 5 | $as_echo "$msg" >&6; } 6 | 7 | -if test "$ICULIBSUFFIX" != "" 8 | -then 9 | - U_HAVE_LIB_SUFFIX=1 10 | - ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/^A-Za-z0-9_/_/g'` 11 | - UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} " 12 | -else 13 | - U_HAVE_LIB_SUFFIX=0 14 | -fi 15 | +# >> SWIFT_ANDROID_PATCH_START 16 | +# if test "$ICULIBSUFFIX" != "" 17 | +# then 18 | +# U_HAVE_LIB_SUFFIX=1 19 | +# ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/^A-Za-z0-9_/_/g'` 20 | +# UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} " 21 | +# else 22 | +# U_HAVE_LIB_SUFFIX=0 23 | +# fi 24 | 25 | +U_HAVE_LIB_SUFFIX=0 26 | +# << SWIFT_ANDROID_PATCH_END 27 | 28 | 29 | # Enable/disable tests 30 | -------------------------------------------------------------------------------- /Patches/icu/source/data/Makefile.in.diff: -------------------------------------------------------------------------------- 1 | diff --git a/icu4c/source/data/Makefile.in b/icu4c/source/data/Makefile.in 2 | index 778b6c7affa28916cd366854fc44f46b8343733d..5c99e6eaf40c287c2cede61a3368112def771fdd 100644 3 | --- a/icu4c/source/data/Makefile.in 4 | +++ b/icu4c/source/data/Makefile.in 5 | @@ -27,7 +27,9 @@ ifeq ($(PKGDATA_OPTS),) 6 | PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc 7 | endif 8 | ifeq ($(PKGDATA_VERSIONING),) 9 | -PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) 10 | +# PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) 11 | +# Disables so-file `libicudataswift.so` versioning. 12 | +PKGDATA_VERSIONING = 13 | endif 14 | 15 | # This allows all the data to be in one directory 16 | -------------------------------------------------------------------------------- /Patches/llbuild/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 766e38e71f5cef142a455a879f1c83203eecacfb..0207d61671d829ba1451b9cc8a4a006401840336 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -209,10 +209,10 @@ endif() 6 | 7 | # Process CMakeLists files for our subdirectories. 8 | add_subdirectory(lib) 9 | -add_subdirectory(perftests) 10 | +# add_subdirectory(perftests) 11 | add_subdirectory(products) 12 | -add_subdirectory(tests) 13 | -add_subdirectory(unittests) 14 | -add_subdirectory(utils/unittest) 15 | -add_subdirectory(utils/adjust-times) 16 | +# add_subdirectory(tests) 17 | +# add_subdirectory(unittests) 18 | +# add_subdirectory(utils/unittest) 19 | +# add_subdirectory(utils/adjust-times) 20 | add_subdirectory(cmake/modules) 21 | -------------------------------------------------------------------------------- /Patches/spm/Sources/Build/BuildPlan.swift.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Build/BuildPlan.swift b/Sources/Build/BuildPlan.swift 2 | index 02fa758f2d0080e86109180279ee327890dd9faa..a710166029e287eeadbb391758e8192e94aa6ef8 100644 3 | --- a/Sources/Build/BuildPlan.swift 4 | +++ b/Sources/Build/BuildPlan.swift 5 | @@ -1438,7 +1438,9 @@ public class BuildPlan { 6 | case .swiftAST: 7 | buildProduct.swiftASTs.insert(description.moduleOutputPath) 8 | case .modulewrap: 9 | - buildProduct.objects += [description.wrappedModuleOutputPath] 10 | + if !buildParameters.triple.isAndroid() { 11 | + buildProduct.objects += [description.wrappedModuleOutputPath] 12 | + } 13 | case nil: 14 | break 15 | } 16 | -------------------------------------------------------------------------------- /Patches/spm/Sources/Build/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Build/CMakeLists.txt b/Sources/Build/CMakeLists.txt 2 | index 373b1bc0fececfbd3517ddfc991d0dc52f369f1c..f103ed3c7bbbfa740effd18772c05cf3f5c432b2 100644 3 | --- a/Sources/Build/CMakeLists.txt 4 | +++ b/Sources/Build/CMakeLists.txt 5 | @@ -23,9 +23,9 @@ target_link_libraries(Build PUBLIC 6 | set_target_properties(Build PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS Build 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/Commands/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Commands/CMakeLists.txt b/Sources/Commands/CMakeLists.txt 2 | index e3b6867c87c856d0225cdb69a378d9ab3d3a77fc..0dfe5323af9cf1708f26ea242c9547ceb9ef6462 100644 3 | --- a/Sources/Commands/CMakeLists.txt 4 | +++ b/Sources/Commands/CMakeLists.txt 5 | @@ -40,9 +40,9 @@ endif() 6 | set_target_properties(Commands PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS Commands 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/LLBuildManifest/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/LLBuildManifest/CMakeLists.txt b/Sources/LLBuildManifest/CMakeLists.txt 2 | index 856b13bf935b59fe4c01e7213dd388fc57787f2e..979d6b5a507f7406596771af2e1d81c599b03dc5 100644 3 | --- a/Sources/LLBuildManifest/CMakeLists.txt 4 | +++ b/Sources/LLBuildManifest/CMakeLists.txt 5 | @@ -20,9 +20,9 @@ target_link_libraries(LLBuildManifest PUBLIC 6 | set_target_properties(LLBuildManifest PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS LLBuildManifest 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/PackageGraph/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/PackageGraph/CMakeLists.txt b/Sources/PackageGraph/CMakeLists.txt 2 | index 7c57ed3b40ecb81819f8392b8a4d70e9f5938e1c..4142568b0f48fae976965e4422d9612da11babe1 100644 3 | --- a/Sources/PackageGraph/CMakeLists.txt 4 | +++ b/Sources/PackageGraph/CMakeLists.txt 5 | @@ -27,9 +27,9 @@ target_link_libraries(PackageGraph PUBLIC 6 | set_target_properties(PackageGraph PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS PackageGraph 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/PackageLoading/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/PackageLoading/CMakeLists.txt b/Sources/PackageLoading/CMakeLists.txt 2 | index 58a5e9de8751df4f0ba31a8b20f161655edac280..ed55506bec7b92f9e7d417b5b275c953acd36b77 100644 3 | --- a/Sources/PackageLoading/CMakeLists.txt 4 | +++ b/Sources/PackageLoading/CMakeLists.txt 5 | @@ -27,9 +27,9 @@ target_link_libraries(PackageLoading PUBLIC 6 | set_target_properties(PackageLoading PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS PackageLoading 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/PackageModel/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/PackageModel/CMakeLists.txt b/Sources/PackageModel/CMakeLists.txt 2 | index 20f193fff4e5d60a0a0a5d7e2ce057bb7747057d..2ab60112da7ec1391eba7f267bbddc1fb63002a0 100644 3 | --- a/Sources/PackageModel/CMakeLists.txt 4 | +++ b/Sources/PackageModel/CMakeLists.txt 5 | @@ -25,9 +25,9 @@ target_link_libraries(PackageModel PUBLIC 6 | set_target_properties(PackageModel PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS PackageModel 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/SPMBuildCore/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/SPMBuildCore/CMakeLists.txt b/Sources/SPMBuildCore/CMakeLists.txt 2 | index 96d22dca625fbc862bfc3eefd1000948f6e14e42..2ba3a945557820f10358c5c11247c627cf4c2453 100644 3 | --- a/Sources/SPMBuildCore/CMakeLists.txt 4 | +++ b/Sources/SPMBuildCore/CMakeLists.txt 5 | @@ -22,9 +22,9 @@ target_link_libraries(SPMBuildCore PUBLIC 6 | PackageGraph) 7 | 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS SPMBuildCore 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/SPMLLBuild/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/SPMLLBuild/CMakeLists.txt b/Sources/SPMLLBuild/CMakeLists.txt 2 | index ba46f5ac5f2ea6ed544b60bb25a39e438bd0c4d2..2889bc39b583f57450fb60bf604375636f680259 100644 3 | --- a/Sources/SPMLLBuild/CMakeLists.txt 4 | +++ b/Sources/SPMLLBuild/CMakeLists.txt 5 | @@ -17,9 +17,9 @@ target_link_libraries(SPMLLBuild PUBLIC 6 | llbuildSwift) 7 | 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS SPMLLBuild 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/SourceControl/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/SourceControl/CMakeLists.txt b/Sources/SourceControl/CMakeLists.txt 2 | index 29388566c807dda691c70a5074ac4846388ad692..9d41c4592ec9ccc7c4c5e041ef91edb5a95c8efd 100644 3 | --- a/Sources/SourceControl/CMakeLists.txt 4 | +++ b/Sources/SourceControl/CMakeLists.txt 5 | @@ -21,9 +21,9 @@ target_link_libraries(SourceControl PUBLIC 6 | set_target_properties(SourceControl PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS SourceControl 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/Workspace/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Workspace/CMakeLists.txt b/Sources/Workspace/CMakeLists.txt 2 | index e19d26c3f35bf53e072578237c6a536068891aa1..1828056145b3facd03c0e77693a1a87e11ea7b85 100644 3 | --- a/Sources/Workspace/CMakeLists.txt 4 | +++ b/Sources/Workspace/CMakeLists.txt 5 | @@ -29,9 +29,9 @@ target_link_libraries(Workspace PUBLIC 6 | set_target_properties(Workspace PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS Workspace 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/XCBuildSupport/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/XCBuildSupport/CMakeLists.txt b/Sources/XCBuildSupport/CMakeLists.txt 2 | index 1a31af13f8b38e389bdee5b4865d0f567b01e481..7ef0f2a942b5e4c401dfc37ae65bfc01e842d2d1 100644 3 | --- a/Sources/XCBuildSupport/CMakeLists.txt 4 | +++ b/Sources/XCBuildSupport/CMakeLists.txt 5 | @@ -23,9 +23,9 @@ target_link_libraries(XCBuildSupport PUBLIC 6 | set_target_properties(XCBuildSupport PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS XCBuildSupport 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/Xcodeproj/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Xcodeproj/CMakeLists.txt b/Sources/Xcodeproj/CMakeLists.txt 2 | index 47dd232a052e6c46e08910ee3aec321ea158c1fc..6180e6e25a870da5be673afb77f2fa16d4746762 100644 3 | --- a/Sources/Xcodeproj/CMakeLists.txt 4 | +++ b/Sources/Xcodeproj/CMakeLists.txt 5 | @@ -21,9 +21,9 @@ target_link_libraries(Xcodeproj PUBLIC 6 | set_target_properties(Xcodeproj PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS Xcodeproj 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | -------------------------------------------------------------------------------- /Patches/spm/Sources/swift-build/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/swift-build/CMakeLists.txt b/Sources/swift-build/CMakeLists.txt 2 | index 6f8a87473c40c7de4f7d82d779d4c13870815e58..b85ce7e244f6c838db9045487b19a16e5daf08c7 100644 3 | --- a/Sources/swift-build/CMakeLists.txt 4 | +++ b/Sources/swift-build/CMakeLists.txt 5 | @@ -11,7 +11,7 @@ add_executable(swift-build 6 | target_link_libraries(swift-build PRIVATE 7 | Commands) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS swift-build 12 | DESTINATION bin) 13 | -endif() 14 | +#endif() 15 | -------------------------------------------------------------------------------- /Patches/spm/Sources/swift-package/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/swift-package/CMakeLists.txt b/Sources/swift-package/CMakeLists.txt 2 | index 1ebf9a3aabff7105be27907a246ed19868eb9b89..7d472eec956712c1c2458a766c5106fbe38f0e0f 100644 3 | --- a/Sources/swift-package/CMakeLists.txt 4 | +++ b/Sources/swift-package/CMakeLists.txt 5 | @@ -11,7 +11,7 @@ add_executable(swift-package 6 | target_link_libraries(swift-package PRIVATE 7 | Commands) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS swift-package 12 | RUNTIME DESTINATION bin) 13 | -endif() 14 | +#endif() 15 | -------------------------------------------------------------------------------- /Patches/spm/Sources/swift-run/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/swift-run/CMakeLists.txt b/Sources/swift-run/CMakeLists.txt 2 | index d879e3c9b3fb990a48e5c9e2061a90babe6bf7b5..34f21752d6886bf2e6e24be4368cc4f76a557ad6 100644 3 | --- a/Sources/swift-run/CMakeLists.txt 4 | +++ b/Sources/swift-run/CMakeLists.txt 5 | @@ -11,7 +11,7 @@ add_executable(swift-run 6 | target_link_libraries(swift-run PRIVATE 7 | Commands) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS swift-run 12 | RUNTIME DESTINATION bin) 13 | -endif() 14 | +#endif() 15 | -------------------------------------------------------------------------------- /Patches/spm/Sources/swift-test/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/swift-test/CMakeLists.txt b/Sources/swift-test/CMakeLists.txt 2 | index fc4912ef34c0783b93ff58e9c15598dbe30b500f..ef951364b9010687f1dca5f470f717cdbab665b3 100644 3 | --- a/Sources/swift-test/CMakeLists.txt 4 | +++ b/Sources/swift-test/CMakeLists.txt 5 | @@ -11,7 +11,7 @@ add_executable(swift-test 6 | target_link_libraries(swift-test PRIVATE 7 | Commands) 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS swift-test 12 | RUNTIME DESTINATION bin) 13 | -endif() 14 | +#endif() 15 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-foundation/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index ecc6c3c9e30c51e70c1c7ed2f2bd074befd824e3..f910d88d2eace7750a0428c9850ef86fe6496a96 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -43,6 +43,14 @@ set(BUILD_SHARED_LIBS NO) 6 | add_subdirectory(CoreFoundation EXCLUDE_FROM_ALL) 7 | set(BUILD_SHARED_LIBS ${SAVED_BUILD_SHARED_LIBS}) 8 | 9 | +# User-configurable Android specific options. 10 | +set(SWIFT_ANDROID_API_LEVEL "" CACHE STRING 11 | + "Version number for the Android API") 12 | +set(SWIFT_ANDROID_NDK_PATH "" CACHE STRING 13 | + "Path to the directory that contains the Android NDK tools that are executable on the build machine") 14 | +set(SWIFT_ANDROID_NDK_GCC_VERSION "" CACHE STRING 15 | + "The GCC version to use when building for Android. Currently only 4.9 is supported.") 16 | + 17 | # Setup include paths for uuid/uuid.h 18 | target_include_directories(CoreFoundation PRIVATE 19 | ${CMAKE_CURRENT_SOURCE_DIR} 20 | @@ -50,7 +58,9 @@ target_include_directories(CoreFoundation PRIVATE 21 | 22 | add_subdirectory(uuid) 23 | add_subdirectory(Foundation) 24 | -add_subdirectory(Tools) 25 | +if(NOT CMAKE_SYSTEM_NAME STREQUAL Android) 26 | + add_subdirectory(Tools) 27 | +endif() 28 | if(ENABLE_TESTING) 29 | add_subdirectory(TestFoundation) 30 | endif() 31 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-foundation/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h b/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h 2 | index a3ebe169bb3eacd598ab804d921c2dc9389d3f60..4ceba2c11b504c20a8dc8144f46824066ae4e265 100644 3 | --- a/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h 4 | +++ b/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h 5 | @@ -32,12 +32,12 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | -#include 16 | 17 | #if __has_include() 18 | #include // for Host.swift 19 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-foundation/CoreFoundation/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CoreFoundation/CMakeLists.txt b/CoreFoundation/CMakeLists.txt 2 | index 90a777234eec54f5701f39ac2425b9ecf6385536..6913ee7430591352d10ea2487ecc836693581e01 100644 3 | --- a/CoreFoundation/CMakeLists.txt 4 | +++ b/CoreFoundation/CMakeLists.txt 5 | @@ -382,7 +382,7 @@ target_include_directories(CoreFoundation 6 | ${PROJECT_SOURCE_DIR} 7 | ${ICU_INCLUDE_DIR}) 8 | target_link_libraries(CoreFoundation PRIVATE 9 | - Threads::Threads 10 | + # Threads::Threads 11 | ${CMAKE_DL_LIBS} 12 | BlocksRuntime 13 | dispatch) 14 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-foundation/Sources/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt 2 | index ab3a1bef110ab7d7b0f5224bfeb2d8cf8be3b216..3a5c62a4b0df4d44050083cfd53d500ff98dee7c 100644 3 | --- a/Sources/CMakeLists.txt 4 | +++ b/Sources/CMakeLists.txt 5 | @@ -2,4 +2,4 @@ add_subdirectory(UUID) 6 | add_subdirectory(Foundation) 7 | add_subdirectory(FoundationNetworking) 8 | add_subdirectory(FoundationXML) 9 | -add_subdirectory(Tools) 10 | +# add_subdirectory(Tools) 11 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-foundation/Sources/Foundation/Process.swift.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Sources/Foundation/Process.swift b/Sources/Foundation/Process.swift 2 | index 21615c19..4734e1bd 100644 3 | --- a/Sources/Foundation/Process.swift 4 | +++ b/Sources/Foundation/Process.swift 5 | @@ -944,14 +944,10 @@ open class Process: NSObject { 6 | try _throwIfPosixError(_CFPosixSpawnFileActionsAddClose(fileActions, fd)) 7 | } 8 | 9 | -#if canImport(Darwin) || os(Android) 10 | +#if canImport(Darwin) 11 | var spawnAttrs: posix_spawnattr_t? = nil 12 | -#else 13 | - var spawnAttrs: posix_spawnattr_t = posix_spawnattr_t() 14 | -#endif 15 | try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs)) 16 | try _throwIfPosixError(posix_spawnattr_setflags(&spawnAttrs, .init(POSIX_SPAWN_SETPGROUP))) 17 | -#if canImport(Darwin) 18 | try _throwIfPosixError(posix_spawnattr_setflags(&spawnAttrs, .init(POSIX_SPAWN_CLOEXEC_DEFAULT))) 19 | #else 20 | // POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple extension so emulate it. 21 | @@ -978,10 +974,16 @@ open class Process: NSObject { 22 | 23 | // Launch 24 | var pid = pid_t() 25 | +#if os(macOS) 26 | guard _CFPosixSpawn(&pid, launchPath, fileActions, &spawnAttrs, argv, envp) == 0 else { 27 | throw _NSErrorWithErrno(errno, reading: true, path: launchPath) 28 | } 29 | posix_spawnattr_destroy(&spawnAttrs) 30 | +#else 31 | + guard _CFPosixSpawn(&pid, launchPath, fileActions, nil, argv, envp) == 0 else { 32 | + throw _NSErrorWithErrno(errno, reading: true, path: launchPath) 33 | + } 34 | +#endif 35 | 36 | // Close the write end of the input and output pipes. 37 | if let pipe = standardInput as? Pipe { 38 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-libdispatch/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 74b7849816c68bf492fd49f76bc735af84bf3ad0..0a1ec4b846243bf0916ce523ea3292340b7fcdf0 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -35,6 +35,14 @@ include(DispatchUtilities) 6 | set(SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript") 7 | set(INSTALL_LIBDIR "${SWIFT_LIBDIR}" CACHE PATH "Path where the libraries should be installed") 8 | 9 | +# User-configurable Android specific options. 10 | +set(SWIFT_ANDROID_API_LEVEL "" CACHE STRING 11 | + "Version number for the Android API") 12 | +set(SWIFT_ANDROID_NDK_PATH "" CACHE STRING 13 | + "Path to the directory that contains the Android NDK tools that are executable on the build machine") 14 | +set(SWIFT_ANDROID_NDK_GCC_VERSION "" CACHE STRING 15 | + "The GCC version to use when building for Android. Currently only 4.9 is supported.") 16 | + 17 | include(DispatchAppleOptions) 18 | include(DispatchSanitization) 19 | 20 | -------------------------------------------------------------------------------- /Patches/swift-corelibs-libdispatch/cmake/modules/DispatchCompilerWarnings.cmake.diff: -------------------------------------------------------------------------------- 1 | diff --git a/cmake/modules/DispatchCompilerWarnings.cmake b/cmake/modules/DispatchCompilerWarnings.cmake 2 | index 35b80f3..1cb43d9 100644 3 | --- a/cmake/modules/DispatchCompilerWarnings.cmake 4 | +++ b/cmake/modules/DispatchCompilerWarnings.cmake 5 | @@ -71,6 +71,10 @@ else() 6 | add_compile_options($<$,$>:-Wno-conversion>) 7 | add_compile_options($<$,$>:-Wno-int-conversion>) 8 | add_compile_options($<$,$>:-Wno-shorten-64-to-32>) 9 | + if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) 10 | + # Needed to avoid issue with `-Werror`. See: https://github.com/vgorloff/swift-everywhere-toolchain/issues/138 11 | + add_compile_options($<$,$>:-Wno-unused-command-line-argument>) 12 | + endif() 13 | endif() 14 | add_compile_options($<$,$>:-Wno-error=assign-enum>) 15 | endif() 16 | -------------------------------------------------------------------------------- /Patches/swift-tools-support-core/Sources/TSCBasic/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/swift-tools-support-core/Sources/TSCBasic/CMakeLists.txt b/swift-tools-support-core/Sources/TSCBasic/CMakeLists.txt 2 | index bbc43d98b048a341bdb8259b37937b416915084d..08ad7c789e22dfe2471979bad0b2eb2207e07aaa 100644 3 | --- a/swift-tools-support-core/Sources/TSCBasic/CMakeLists.txt 4 | +++ b/swift-tools-support-core/Sources/TSCBasic/CMakeLists.txt 5 | @@ -60,12 +60,12 @@ set_target_properties(TSCBasic PROPERTIES 6 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 7 | 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS TSCBasic 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | 18 | # Don't use GNU strerror_r on Android. 19 | if(CMAKE_SYSTEM_NAME STREQUAL Android) 20 | -------------------------------------------------------------------------------- /Patches/swift-tools-support-core/Sources/TSCLibc/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/swift-tools-support-core/Sources/TSCLibc/CMakeLists.txt b/swift-tools-support-core/Sources/TSCLibc/CMakeLists.txt 2 | index e8b1cc7c35776235788c86a07a9847a7064ec563..32cda2466895dc99c7af22c1f777eeac02766770 100644 3 | --- a/swift-tools-support-core/Sources/TSCLibc/CMakeLists.txt 4 | +++ b/swift-tools-support-core/Sources/TSCLibc/CMakeLists.txt 5 | @@ -20,11 +20,11 @@ set_target_properties(TSCLibc PROPERTIES 6 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 7 | 8 | 9 | -if(CMAKE_SYSTEM_NAME STREQUAL Windows) 10 | +#if(CMAKE_SYSTEM_NAME STREQUAL Windows) 11 | install(TARGETS TSCLibc 12 | ARCHIVE DESTINATION lib 13 | LIBRARY DESTINATION lib 14 | RUNTIME DESTINATION bin) 15 | -endif() 16 | +#endif() 17 | 18 | set_property(GLOBAL APPEND PROPERTY TSC_EXPORTS TSCLibc) 19 | -------------------------------------------------------------------------------- /Patches/swift-tools-support-core/Sources/TSCUtility/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/swift-tools-support-core/Sources/TSCUtility/CMakeLists.txt b/swift-tools-support-core/Sources/TSCUtility/CMakeLists.txt 2 | index f7db9246dfe8bd2f1ce41f6fa2c359d9d06b6afc..ae1b1f7f3c860d3e32e48cfe58ecdab1179e4519 100644 3 | --- a/swift-tools-support-core/Sources/TSCUtility/CMakeLists.txt 4 | +++ b/swift-tools-support-core/Sources/TSCUtility/CMakeLists.txt 5 | @@ -44,4 +44,9 @@ endif() 6 | set_target_properties(TSCUtility PROPERTIES 7 | INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) 8 | 9 | +install(TARGETS TSCUtility 10 | + ARCHIVE DESTINATION lib 11 | + LIBRARY DESTINATION lib 12 | + RUNTIME DESTINATION bin) 13 | + 14 | set_property(GLOBAL APPEND PROPERTY TSC_EXPORTS TSCUtility) 15 | -------------------------------------------------------------------------------- /Patches/swift/cmake/modules/Libdispatch.cmake.diff: -------------------------------------------------------------------------------- 1 | diff --git a/cmake/modules/Libdispatch.cmake b/cmake/modules/Libdispatch.cmake 2 | index bc03326d908..c435fe5d5b9 100644 3 | --- a/cmake/modules/Libdispatch.cmake 4 | +++ b/cmake/modules/Libdispatch.cmake 5 | @@ -100,6 +100,8 @@ foreach(sdk ${DISPATCH_SDKS}) 6 | "-DCMAKE_ANDROID_NDK=${SWIFT_ANDROID_NDK_PATH}" 7 | -DCMAKE_ANDROID_ARCH_ABI=${SWIFT_SDK_ANDROID_ARCH_${arch}_ABI} 8 | -DCMAKE_ANDROID_API=${SWIFT_ANDROID_API_LEVEL} 9 | + -DANDROID_PLATFORM=${ANDROID_PLATFORM} 10 | + -DANDROID_ABI=${ANDROID_ABI} 11 | -DBUILD_SHARED_LIBS=YES 12 | -DENABLE_SWIFT=NO 13 | -DENABLE_TESTING=NO 14 | -------------------------------------------------------------------------------- /Patches/swift/cmake/modules/SwiftConfigureSDK.cmake.diff: -------------------------------------------------------------------------------- 1 | diff --git a/cmake/modules/SwiftConfigureSDK.cmake b/cmake/modules/SwiftConfigureSDK.cmake 2 | index b55e6e6b9866e8738c999438d480bd9ccd4b46df..ea51c15ca9eb1489f03c37ac3e8e970adf3fa1df 100644 3 | --- a/cmake/modules/SwiftConfigureSDK.cmake 4 | +++ b/cmake/modules/SwiftConfigureSDK.cmake 5 | @@ -272,8 +272,8 @@ macro(configure_sdk_unix name architectures) 6 | foreach(arch ${architectures}) 7 | if("${prefix}" STREQUAL "ANDROID") 8 | if(NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "") 9 | - set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NDK_PATH}/sysroot/usr/include" CACHE STRING "Path to C library headers") 10 | - set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NDK_PATH}/sysroot/usr/include" CACHE STRING "Path to C library architecture headers") 11 | + set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include" CACHE STRING "Path to C library headers") 12 | + set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include" CACHE STRING "Path to C library architecture headers") 13 | elseif(NOT "${SWIFT_ANDROID_NATIVE_SYSROOT}" STREQUAL "") 14 | set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NATIVE_SYSROOT}/usr/include" CACHE STRING "Path to C library headers") 15 | set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_ANDROID_NATIVE_SYSROOT}/usr/include" CACHE STRING "Path to C library architecture headers") 16 | -------------------------------------------------------------------------------- /Patches/swift/stdlib/cmake/modules/AddSwiftStdlib.cmake.diff: -------------------------------------------------------------------------------- 1 | diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake 2 | index 38191b01a64d67222b1ffbd8617ea0a96594e7aa..fb5afce4814afd49bf2d257ecdd5e4cd299326f9 100644 3 | --- a/stdlib/cmake/modules/AddSwiftStdlib.cmake 4 | +++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake 5 | @@ -2046,6 +2046,16 @@ function(add_swift_target_library name) 6 | list(APPEND THIN_INPUT_TARGETS ${VARIANT_NAME}) 7 | endif() 8 | endif() 9 | + 10 | + if(sdk IN_LIST SWIFT_APPLE_PLATFORMS) 11 | + # See: https://github.com/apple/swift/pull/38415/files 12 | + # In the past, we relied on unsetting globally 13 | + # CMAKE_OSX_ARCHITECTURES to ensure that CMake would 14 | + # not add the -arch flag 15 | + # This is no longer the case when running on Apple Silicon, 16 | + # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291) 17 | + set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}") 18 | + endif() 19 | endforeach() 20 | 21 | # Configure module-only targets 22 | @@ -2483,6 +2493,14 @@ function(add_swift_target_executable name) 23 | endif() 24 | 25 | if(${sdk} IN_LIST SWIFT_APPLE_PLATFORMS) 26 | + # See: https://github.com/apple/swift/pull/38415/files 27 | + # In the past, we relied on unsetting globally 28 | + # CMAKE_OSX_ARCHITECTURES to ensure that CMake would 29 | + # not add the -arch flag 30 | + # This is no longer the case when running on Apple Silicon, 31 | + # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291) 32 | + set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}") 33 | + 34 | add_custom_command_target(unused_var2 35 | COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}" 36 | CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed" 37 | -------------------------------------------------------------------------------- /Patches/swift/stdlib/private/CMakeLists.txt.diff: -------------------------------------------------------------------------------- 1 | diff --git a/stdlib/private/CMakeLists.txt b/stdlib/private/CMakeLists.txt 2 | index 181aec48a9e2dec76b489c94939cb66d0f2f92a2..0ff445fbafc92b9c197a6494e5eec5e70f2053e3 100644 3 | --- a/stdlib/private/CMakeLists.txt 4 | +++ b/stdlib/private/CMakeLists.txt 5 | @@ -10,7 +10,7 @@ if(SWIFT_BUILD_SDK_OVERLAY) 6 | endif() 7 | endif() 8 | 9 | -if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES) 10 | +if(SWIFT_INCLUDE_TESTS AND (SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)) 11 | add_subdirectory(RuntimeUnittest) 12 | add_subdirectory(StdlibUnicodeUnittest) 13 | add_subdirectory(StdlibCollectionUnittest) 14 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | # Releasing 2 | 3 | 1. Update version in file `/VERSION` 4 | 2. Add new record in a `/CHANGELOG.md` file. 5 | 3. If Android NDK version (in file `NDK_VERSION`) is changed, then update following files: 6 | 7 | - Readme.md 8 | - Assets/android-copy-libs 9 | - Assets/android-swift-build 10 | - Assets/android-swiftc 11 | - Assets/Readme.md 12 | 13 | 4. Test toolchain: 14 | 15 | 1. Run `node main.js verify` 16 | 2. Run `node main.js test` 17 | 3. Compare in Diff-Tool contents of the Toolchain with contents of the Toolchain from previous build. 18 | 4. Run samples from [swift-everywhere-samples](https://github.com/vgorloff/swift-everywhere-samples) repository. 19 | -------------------------------------------------------------------------------- /Tests/ADB.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | 3 | const Tool = require("../lib/Tool"); 4 | 5 | module.exports = class ADB extends Tool { 6 | constructor(/** @type {String} */ executable, /** @type {[String]} */ libs) { 7 | super(); 8 | this.executable = executable; 9 | this.libs = libs; 10 | this.component = path.basename(executable); 11 | this.destinationDirPath = `/data/local/tmp/sample-${this.component}`; 12 | this.binary = path.join(this.destinationDirPath, this.component); 13 | } 14 | 15 | static verify() { 16 | var tool = new Tool(); 17 | 18 | // See: Enable adb debugging on your device – https://developer.android.com/studio/command-line/adb#Enabling 19 | // On linux `execute "sudo apt-get install android-tools-adb"` 20 | 21 | tool.execute("adb devices"); // To run daemon. 22 | tool.logMessage( 23 | 'Make sure you are enabled "USB debugging" on Android device (See :https://developer.android.com/studio/command-line/adb#Enabling)' 24 | ); 25 | tool.execute("adb devices"); // # To list devices. 26 | } 27 | 28 | deploy() { 29 | this.undeploy(); 30 | this.logMessage("Deploy of Shared Objects started."); 31 | this.execute(`adb shell mkdir -p ${this.destinationDirPath}`); 32 | this.libs.forEach((item) => this.execute(`adb push ${item} ${this.destinationDirPath}`)) 33 | this.execute(`adb push ${this.executable} ${this.destinationDirPath}`); 34 | this.logMessage("Deploy of Shared Objects completed."); 35 | } 36 | 37 | run() { 38 | this.execute(`adb shell ls -l ${this.destinationDirPath}`) 39 | this.logMessage(`Starting execution of "${this.binary}"...`) 40 | this.execute(`adb shell LD_LIBRARY_PATH=${this.destinationDirPath} ${this.binary}`) 41 | this.logMessage(`Execution of "${this.binary}" is completed.`) 42 | } 43 | 44 | undeploy() { 45 | this.execute(`adb shell rm -rf ${this.destinationDirPath}`); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /Tests/ProjectBuilder.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | const cp = require("child_process"); 3 | 4 | const Tool = require("../lib/Tool"); 5 | const Arch = require("../lib/Archs/Arch"); 6 | const Config = require("../lib/Config"); 7 | const ADB = require("./ADB"); 8 | 9 | module.exports = class ProjectBuilder extends Tool { 10 | constructor(/** @type {String} */ component, /** @type {Arch} */ arch) { 11 | super(); 12 | var args = process.argv.slice(2); 13 | this.isVerbose = args.filter((item) => item == "--verbose").length > 0; 14 | 15 | this.arch = arch; 16 | this.component = component; 17 | this.rootPath = path.join(Config.root, "Tests", `sample-${component}`); 18 | this.sourcesPath = path.join(this.rootPath, "Sources"); 19 | this.buildPath = path.join(this.rootPath, "build", arch.name); 20 | this.binariesDirPath = path.join(Config.root, "Assets"); 21 | if (arch.name == "armv7a") { 22 | this.ndkArchPath = "arm-linux-androideabi"; 23 | this.swiftTarget = "armv7-unknown-linux-android"; 24 | } else if (arch.name == "x86") { 25 | this.ndkArchPath = "i686-linux-android"; 26 | this.swiftTarget = "i686-unknown-linux-android"; 27 | } else if (arch.name == "aarch64") { 28 | this.ndkArchPath = "aarch64-linux-android"; 29 | this.swiftTarget = "aarch64-unknown-linux-android"; 30 | } else if (arch.name == "x86_64") { 31 | this.ndkArchPath = "x86_64-linux-android"; 32 | this.swiftTarget = "x86_64-unknown-linux-android"; 33 | } 34 | this.swftcCmdPath = `${this.binariesDirPath}/swiftc-${this.ndkArchPath} -module-cache-path ${this.buildPath}/ModuleCache`; 35 | this.copyLibsCmdPath = `${this.binariesDirPath}/copy-libs-${this.ndkArchPath}`; 36 | 37 | this.swiftBuildCmd = `${this.binariesDirPath}/swift-build-${this.ndkArchPath} --build-path "${this.buildPath}"`; 38 | 39 | if (this.isVerbose) { 40 | this.swftcCmdPath += " -v -Xcc -v"; 41 | this.copyLibsCmdPath += " -v"; 42 | this.swiftBuildCmd += " -v"; 43 | } 44 | 45 | this.binary = `${this.buildPath}/${this.component}`; 46 | this.libsDirPath = path.join(this.buildPath, "libs"); 47 | } 48 | 49 | runAction(/** @type {String} */ action) { 50 | if (action == "build") { 51 | this.build(); 52 | } else if (action == "deploy") { 53 | this.deploy(); 54 | } else if (action == "undeploy") { 55 | this.undeploy(); 56 | } else if (action == "clean") { 57 | this.clean(); 58 | } else { 59 | this.logError(`! Unknown action \"${action}\".`); 60 | process.exit(1); 61 | } 62 | } 63 | 64 | executeBuild() {} 65 | 66 | copyLibs() { 67 | this.execute(`rm -rf "${this.libsDirPath}"`); 68 | this.execute(`${this.copyLibsCmdPath} -output "${this.libsDirPath}"`); 69 | } 70 | 71 | get libs() { 72 | var libs = cp.execSync(`find "${this.libsDirPath}" -iname *.so -depth 1 || true`).toString().trim().split("\n"); 73 | return libs; 74 | } 75 | 76 | deploy() { 77 | let adb = new ADB(this.binary, this.libs); 78 | adb.deploy(); 79 | adb.run(); 80 | } 81 | 82 | undeploy() { 83 | new ADB(this.binary, this.libs).undeploy(); 84 | } 85 | 86 | build() { 87 | this.clean(); 88 | this.execute(`mkdir -p "${this.buildPath}"`); 89 | this.executeBuild(); 90 | } 91 | 92 | clean() { 93 | this.execute(`rm -rf "${this.buildPath}"`); 94 | } 95 | }; 96 | -------------------------------------------------------------------------------- /Tests/TestAutomation.js: -------------------------------------------------------------------------------- 1 | const Tool = require("../lib/Tool"); 2 | const ExecutableBuilder = require("./sample-exe/Builder"); 3 | const LibraryBuilder = require("./sample-lib/Builder"); 4 | const PackageBuilder = require("./sample-pkg/Builder"); 5 | const ADB = require("./ADB"); 6 | 7 | module.exports = class TestAutomation extends Tool { 8 | constructor() { 9 | super(); 10 | } 11 | 12 | run() { 13 | var args = process.argv.slice(2); 14 | var action = args[0]; 15 | if (!action) { 16 | this.usage(); 17 | process.exit(1); 18 | } else { 19 | if (action == "verify") { 20 | this.verify(); 21 | } else if (action == "clean") { 22 | this.clean(); 23 | } else { 24 | var components = action.split(":"); 25 | if (components.length == 2) { 26 | this.runComponentAction(components[0], components[1]); 27 | } else { 28 | this.usage(); 29 | process.exit(1); 30 | } 31 | } 32 | } 33 | } 34 | 35 | /** @private */ 36 | runComponentAction(component, action) { 37 | if (component == "exe") { 38 | this.archs.forEach((item) => new ExecutableBuilder(component, item).runAction(action)); 39 | } else if (component == "lib") { 40 | this.archs.forEach((item) => new LibraryBuilder(component, item).runAction(action)); 41 | } else if (component == "pkg") { 42 | this.archs.forEach((item) => new PackageBuilder(component, item).runAction(action)); 43 | } else { 44 | this.logError(`! Unknown component \"${component}\".`); 45 | this.usage(); 46 | process.exit(1); 47 | } 48 | } 49 | 50 | verify() { 51 | ADB.verify(); 52 | } 53 | 54 | build() { 55 | this.runComponentAction("exe", "build"); 56 | this.runComponentAction("lib", "build"); 57 | this.runComponentAction("pkg", "build"); 58 | } 59 | 60 | clean() { 61 | this.runComponentAction("exe", "clean"); 62 | this.runComponentAction("lib", "clean"); 63 | this.runComponentAction("pkg", "clean"); 64 | } 65 | 66 | /** @private */ 67 | usage() { 68 | this.print("\n1. Build project:", 32); 69 | this.print(" $ node main.js :build", 36); 70 | this.print(" $ node main.js :build arch:\n", 36); 71 | this.print(" Where the is one of: [exe|lib|pkg]", 36); 72 | this.print(" Where the is one of: [armv7a|aarch64|x86|x86_64]\n", 36); 73 | 74 | this.print( 75 | "2. Enable USB Debugging on Android device. Install Android Tools for macOS. Connect Android device and Verify ADB shell setup.", 76 | 32 77 | ); 78 | var help = ` 79 | $ node main.js verify 80 | 81 | References: 82 | - How to Install Android Tools for macOS: https://stackoverflow.com/questions/17901692/set-up-adb-on-mac-os-x 83 | - How to Enable USB Debugging on Android device: https://developer.android.com/studio/debug/dev-options 84 | `; 85 | this.print(help, 36); 86 | 87 | this.print("3. Deploy and run project on Android Device or Simulator.", 32); 88 | this.print(` $ node main.js :deploy arch:\n`, 36); 89 | 90 | this.print("4. (Optional) Clean deployed project:", 32); 91 | this.print(" $ node main.js :undeploy arch:", 36); 92 | 93 | this.print("\n5. (Optional) Clean project:", 32); 94 | this.print(" $ node main.js :clean", 36); 95 | this.print(" $ node main.js :clean arch:\n", 36); 96 | } 97 | }; 98 | -------------------------------------------------------------------------------- /Tests/main.js: -------------------------------------------------------------------------------- 1 | var TestAutomation = require("./TestAutomation") 2 | new TestAutomation().run() 3 | -------------------------------------------------------------------------------- /Tests/sample-exe/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /Tests/sample-exe/Builder.js: -------------------------------------------------------------------------------- 1 | const ProjectBuilder = require("../ProjectBuilder"); 2 | 3 | module.exports = class Builder extends ProjectBuilder { 4 | executeBuild() { 5 | var cmd = ` 6 | cd "${this.buildPath}" && 7 | ${this.swftcCmdPath} -emit-executable -o "${this.binary}" 8 | "${this.sourcesPath}/main.swift" 9 | `; 10 | this.executeCommands(cmd); 11 | this.copyLibs(); 12 | this.execute(`file ${this.binary}`); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /Tests/sample-exe/Sources/main.swift: -------------------------------------------------------------------------------- 1 | // ~~~~~~~~~~~~~~ CORE 2 | print("SA - SwiftCore: Works!") 3 | 4 | #if true 5 | // ~~~~~~~~~~~~~~ DISPATCH 6 | import Dispatch 7 | let sema = DispatchSemaphore(value: 0) 8 | 9 | let queue = DispatchQueue(label: "queueName") 10 | queue.async { 11 | print("SA - DispatchQueue: Works!") 12 | sema.signal() 13 | } 14 | 15 | if sema.wait(timeout: .now() + 10) == .timedOut { 16 | print("SA - DispatchQueue: Timeout.") 17 | } 18 | #endif 19 | 20 | #if true // CoreFoundation 21 | import CoreFoundation 22 | 23 | #if os(Android) 24 | let mode = kCFRunLoopDefaultMode 25 | #else 26 | let mode = CFRunLoopMode.defaultMode 27 | #endif 28 | 29 | let result = CFRunLoopRunInMode(mode, 1.0, false) 30 | //let x = kCFRunLoopRunFinished // This line won't compile on Android 31 | _ = CFRunLoopRunResult.finished 32 | switch result { 33 | case .finished: 34 | break 35 | case .handledSource: 36 | break 37 | case .stopped: 38 | break 39 | case .timedOut: 40 | break 41 | @unknown default: 42 | break 43 | } 44 | #endif // CoreFoundation 45 | 46 | #if true 47 | // ~~~~~~~~~~~~~~ FOUNDATION 48 | import Foundation 49 | 50 | let op = BlockOperation { 51 | print("SA - BlockOperation: Works!") 52 | } 53 | let opQueue = OperationQueue() 54 | opQueue.addOperations([op], waitUntilFinished: true) 55 | #endif 56 | 57 | 58 | #if true 59 | // ~~~~~~~~~~~~~~~~ Serialization 60 | let json = ["name": "SA - JSONSerialization/JSONDecoder: Works!"] 61 | do { 62 | let data = try JSONSerialization.data(withJSONObject: json, options: []) 63 | struct Person: Decodable { 64 | let name: String 65 | } 66 | 67 | let person = try JSONDecoder().decode(Person.self, from: data) 68 | print(person.name) 69 | 70 | } catch { 71 | print(error) 72 | } 73 | #endif 74 | 75 | 76 | #if true 77 | import FoundationNetworking 78 | 79 | let config = URLSessionConfiguration.default 80 | let session = URLSession(configuration: config) 81 | if let url = URL(string: "http://www.example.com") { 82 | let sema2 = DispatchSemaphore(value: 0) 83 | let task = session.dataTask(with: url) { data, response, error in 84 | if let response = response { 85 | print("Response: \(response)") 86 | } 87 | if let error = error { 88 | print("Error: \(error)") 89 | } 90 | if let data = data { 91 | print(data) 92 | } 93 | sema2.signal() 94 | } 95 | print("URL Task: \(task)") 96 | task.resume() 97 | if sema2.wait(timeout: .now() + 10) == .timedOut { 98 | print("~~~~~~") 99 | } 100 | } else { 101 | print("bad url") 102 | } 103 | #endif 104 | -------------------------------------------------------------------------------- /Tests/sample-lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /Tests/sample-lib/Builder.js: -------------------------------------------------------------------------------- 1 | const ProjectBuilder = require("../ProjectBuilder") 2 | 3 | module.exports = class Builder extends ProjectBuilder { 4 | 5 | constructor(component, arch) { 6 | super(component, arch) 7 | this.moduleName = "HelloMessages" 8 | this.libFilePath = `${this.buildPath}/lib${this.moduleName}.so` 9 | } 10 | 11 | executeBuild() { 12 | // Lib 13 | var cmd = ` 14 | cd "${this.buildPath}" && 15 | ${this.swftcCmdPath} -emit-library -emit-module -parse-as-library -module-name ${this.moduleName} 16 | -o "${this.libFilePath}" "${this.sourcesPath}/HelloMessage.swift" 17 | `; 18 | this.executeCommands(cmd); 19 | 20 | var cmd = ` 21 | cd "${this.buildPath}" && 22 | ${this.swftcCmdPath} -emit-executable -I ${this.buildPath} -L ${this.buildPath} -l${this.moduleName} 23 | -o "${this.binary}" ${this.sourcesPath}/main.swift 24 | ` 25 | this.executeCommands(cmd); 26 | 27 | // Swift Libs 28 | this.copyLibs() 29 | 30 | this.execute(`file "${this.binary}"`) 31 | this.execute(`file "${this.libFilePath}"`) 32 | 33 | } 34 | 35 | get libs() { 36 | var value = super.libs 37 | value.push(this.libFilePath) 38 | return value 39 | } 40 | 41 | }; 42 | -------------------------------------------------------------------------------- /Tests/sample-lib/Sources/HelloMessage.swift: -------------------------------------------------------------------------------- 1 | import Dispatch 2 | import Foundation 3 | import FoundationNetworking 4 | 5 | public class HelloMessage { 6 | 7 | public init() { 8 | } 9 | 10 | public func execute() { 11 | 12 | // ~~~~~~~~~~~~~~ CORE 13 | print("SA - SwiftCore: Works!") 14 | 15 | // ~~~~~~~~~~~~~~ DISPATCH 16 | let sema = DispatchSemaphore(value: 0) 17 | 18 | let queue = DispatchQueue(label: "queueName") 19 | queue.async { 20 | print("SA - DispatchQueue: Works!") 21 | sema.signal() 22 | } 23 | 24 | if sema.wait(timeout: .now() + 10) == .timedOut { 25 | print("SA - DispatchQueue: Timeout.") 26 | } 27 | 28 | // ~~~~~~~~~~~~~~ FOUNDATION 29 | let op = BlockOperation { 30 | print("SA - BlockOperation: Works!") 31 | } 32 | let opQueue = OperationQueue() 33 | opQueue.addOperations([op], waitUntilFinished: true) 34 | 35 | // ~~~~~~~~~~~~~~~~ Serialization 36 | let json = ["name": "SA - JSONSerialization/JSONDecoder: Works!"] 37 | do { 38 | let data = try JSONSerialization.data(withJSONObject: json, options: []) 39 | struct Person: Decodable { 40 | let name: String 41 | } 42 | 43 | let person = try JSONDecoder().decode(Person.self, from: data) 44 | print(person.name) 45 | 46 | } catch { 47 | print(error) 48 | } 49 | 50 | let config = URLSessionConfiguration.default 51 | let session = URLSession(configuration: config) 52 | if let url = URL(string: "http://www.example.com") { 53 | let sema2 = DispatchSemaphore(value: 0) 54 | let task = session.dataTask(with: url) { data, response, error in 55 | if let response = response { 56 | print("Response: \(response)") 57 | } 58 | if let error = error { 59 | print("Error: \(error)") 60 | } 61 | if let data = data { 62 | print(data) 63 | } 64 | sema2.signal() 65 | } 66 | print("URL Task: \(task)") 67 | task.resume() 68 | if sema2.wait(timeout: .now() + 10) == .timedOut { 69 | print("~~~~~~") 70 | } 71 | } else { 72 | print("bad url") 73 | } 74 | 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Tests/sample-lib/Sources/main.swift: -------------------------------------------------------------------------------- 1 | import HelloMessages 2 | 3 | let message = HelloMessage() 4 | message.execute() 5 | -------------------------------------------------------------------------------- /Tests/sample-pkg/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.build 3 | /.swiftpm -------------------------------------------------------------------------------- /Tests/sample-pkg/Builder.js: -------------------------------------------------------------------------------- 1 | const ProjectBuilder = require("../ProjectBuilder") 2 | 3 | module.exports = class Builder extends ProjectBuilder { 4 | 5 | constructor(component, arch) { 6 | super(component, arch) 7 | this.buildConfig = "release" 8 | this.binary = `${this.buildPath}/${this.buildConfig}/Exe` 9 | this.libFilePath = `${this.buildPath}/${this.buildConfig}/libLib.so` 10 | } 11 | 12 | executeBuild() { 13 | this.execute(`cd "${this.rootPath}" && ${this.swiftBuildCmd}`); 14 | this.execute(`cd "${this.rootPath}" && ${this.swiftBuildCmd} -c ${this.buildConfig}`); 15 | 16 | // Swift Libs 17 | this.copyLibs() 18 | 19 | this.execute(`file ${this.binary}`) 20 | this.execute(`file ${this.libFilePath}`) 21 | } 22 | 23 | get libs() { 24 | var value = super.libs 25 | value.push(this.libFilePath) 26 | return value 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.5.0 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "HelloJNI", 7 | products: [ 8 | // See: https://theswiftdev.com/2019/01/14/all-about-the-swift-package-manager-and-the-swift-toolchain/ 9 | .library(name: "Lib", type: .dynamic, targets: ["Lib"]), 10 | .library(name: "CLib", targets: ["CLib"]), 11 | .library(name: "CppLib", targets: ["CppLib"]), 12 | ], 13 | targets: [ 14 | .target(name: "Lib", dependencies: ["CLib", "CppLib", "CStdLib", "StdLib"]), 15 | .executableTarget(name: "Exe", dependencies: ["Lib", "SAConcurrency"]), 16 | .target(name: "CLib"), 17 | .target(name: "CppLib"), 18 | .target(name: "CStdLib"), 19 | .target(name: "StdLib"), 20 | .target(name: "SAConcurrency"), 21 | ] 22 | ) 23 | package.platforms = [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)] 24 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CLib/Example.c: -------------------------------------------------------------------------------- 1 | // 2 | // File.c 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #include "Example.h" 9 | 10 | void c_sayHello() { 11 | printf("[C] Hello from C\n"); 12 | } 13 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CLib/Example.h: -------------------------------------------------------------------------------- 1 | // 2 | // File.h 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #ifndef File_h 9 | #define File_h 10 | 11 | #include 12 | 13 | void c_sayHello(); 14 | 15 | #endif /* File_h */ 16 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CLib/include/Clib.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #ifndef Header_h 9 | #define Header_h 10 | 11 | #include "../Example.h" 12 | 13 | #endif /* Header_h */ 14 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CStdLib/FILE.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void test() { 4 | // declaring pointer of FILE type 5 | FILE *fp1, *fp2; 6 | char c; 7 | 8 | // pointing fp1 to a file geeky.txt to read from it. 9 | fp1 = fopen("geeky.txt", "r"); 10 | 11 | // pointing fp2 to a file outgeeky.txt 12 | // to write to it. 13 | fp2 = fopen("outgeeky.txt", "w"); 14 | 15 | // reading a character from file. 16 | fscanf(fp1, "%c", &c); 17 | 18 | // writing a character to file. 19 | fprintf(fp2, "%c", c); 20 | } 21 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CStdLib/include/CStdLib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vgorloff/swift-everywhere-toolchain/c3a1cb918f741daa8a49675c1f18e02593108316/Tests/sample-pkg/Sources/CStdLib/include/CStdLib.h -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CppLib/CppToC.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // File.c 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #include "CppToC.h" 9 | #include "MyClass.hpp" 10 | 11 | void* MyClass_init() { 12 | return new MyClass(); 13 | } 14 | 15 | void MyClass_sayHello(void* instance) { 16 | ((MyClass*)instance)->sayHello(); 17 | } 18 | 19 | void MyClass_destroy(void* instance) { 20 | delete ((MyClass*)instance); 21 | } 22 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CppLib/CppToC.h: -------------------------------------------------------------------------------- 1 | // 2 | // File.h 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #ifndef File_h 9 | #define File_h 10 | 11 | #endif /* File_h */ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void* _Nonnull MyClass_init(); 18 | void MyClass_sayHello(void* _Nonnull); 19 | void MyClass_destroy(void* _Nonnull); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CppLib/MyClass.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // File.cpp 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #include "MyClass.hpp" 9 | 10 | MyClass::MyClass() { 11 | std::cout << "[C++] constructor." << std::endl; 12 | } 13 | 14 | void MyClass::sayHello() { 15 | std::cout << "[C++] Hello from C++" << std::endl; 16 | } 17 | 18 | MyClass::~MyClass() { 19 | std::cout << "[C++] destructor." << std::endl; 20 | } 21 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CppLib/MyClass.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // File.hpp 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #ifndef File_hpp 9 | #define File_hpp 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | class MyClass { 16 | public: 17 | MyClass(); 18 | void sayHello(); 19 | ~MyClass(); 20 | }; 21 | 22 | #endif /* File_hpp */ 23 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/CppLib/include/CppLib.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | #ifndef Header_h 9 | #define Header_h 10 | 11 | #include "../CppToC.h" 12 | 13 | #endif /* Header_h */ 14 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/Exe/SAConcurrencyConsumer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Vlad Gorlov on 01.01.22. 6 | // 7 | 8 | import Foundation 9 | import SAConcurrency 10 | 11 | class SAConcurrencyConsumer { 12 | 13 | private lazy var executor = SAConcurrencyMain() 14 | 15 | func consume() { 16 | let sema = DispatchSemaphore(value: 0) 17 | executor.execute { 18 | sema.signal() 19 | } 20 | if sema.wait(timeout: .now() + 10) == .timedOut { 21 | fatalError("Timeout should never happen") 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/Exe/main.swift: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | swift_c_sayHello() 4 | swift_cpp_sayHello() 5 | 6 | // ~~~~~~~~~~~~~~ CORE 7 | print("SA - SwiftCore: Works!") 8 | 9 | #if true 10 | // ~~~~~~~~~~~~~~ DISPATCH 11 | import Dispatch 12 | let sema = DispatchSemaphore(value: 0) 13 | 14 | let queue = DispatchQueue(label: "queueName") 15 | queue.async { 16 | print("SA - DispatchQueue: Works!") 17 | sema.signal() 18 | } 19 | 20 | if sema.wait(timeout: .now() + 10) == .timedOut { 21 | print("SA - DispatchQueue: Timeout.") 22 | } 23 | #endif 24 | 25 | 26 | #if true // CoreFoundation 27 | import CoreFoundation 28 | 29 | #if os(Android) 30 | let mode = kCFRunLoopDefaultMode 31 | #else 32 | let mode = CFRunLoopMode.defaultMode 33 | #endif 34 | 35 | let result = CFRunLoopRunInMode(mode, 1.0, false) 36 | //let x = kCFRunLoopRunFinished // This line won't compile on Android 37 | _ = CFRunLoopRunResult.finished 38 | switch result { 39 | case .finished: 40 | break 41 | case .handledSource: 42 | break 43 | case .stopped: 44 | break 45 | case .timedOut: 46 | break 47 | @unknown default: 48 | break 49 | } 50 | #endif // CoreFoundation 51 | 52 | 53 | #if true 54 | // ~~~~~~~~~~~~~~ FOUNDATION 55 | import Foundation 56 | 57 | let op = BlockOperation { 58 | print("SA - BlockOperation: Works!") 59 | } 60 | let opQueue = OperationQueue() 61 | opQueue.addOperations([op], waitUntilFinished: true) 62 | #endif 63 | 64 | 65 | #if true 66 | // ~~~~~~~~~~~~~~~~ Serialization 67 | let json = ["name": "SA - JSONSerialization/JSONDecoder: Works!"] 68 | do { 69 | let data = try JSONSerialization.data(withJSONObject: json, options: []) 70 | struct Person: Decodable { 71 | let name: String 72 | } 73 | 74 | let person = try JSONDecoder().decode(Person.self, from: data) 75 | print(person.name) 76 | 77 | } catch { 78 | print(error) 79 | } 80 | #endif 81 | 82 | 83 | #if true 84 | #if os(Android) 85 | import FoundationNetworking 86 | #endif 87 | 88 | let config = URLSessionConfiguration.default 89 | let session = URLSession(configuration: config) 90 | if let url = URL(string: "http://www.example.com") { 91 | let sema2 = DispatchSemaphore(value: 0) 92 | let task = session.dataTask(with: url) { data, response, error in 93 | if let response = response { 94 | print("Response: \(response)") 95 | } 96 | if let error = error { 97 | print("Error: \(error)") 98 | } 99 | if let data = data { 100 | print(data) 101 | } 102 | sema2.signal() 103 | } 104 | print("URL Task: \(task)") 105 | task.resume() 106 | if sema2.wait(timeout: .now() + 10) == .timedOut { 107 | print("~~~~~~") 108 | } 109 | } else { 110 | print("bad url") 111 | } 112 | #endif 113 | 114 | // let consumer = SAConcurrencyConsumer() 115 | // consumer.consume() 116 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/Lib/CLibConsumer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | import Foundation 9 | import CLib 10 | 11 | public func swift_c_sayHello() { 12 | c_sayHello() 13 | } 14 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/Lib/CppLibConsumer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Vlad Gorlov on 23.11.20. 6 | // 7 | 8 | import Foundation 9 | import CppLib 10 | 11 | public func swift_cpp_sayHello() { 12 | 13 | let instance = MyClass_init() 14 | MyClass_sayHello(instance) 15 | MyClass_destroy(instance) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/Lib/HelloMessage.swift: -------------------------------------------------------------------------------- 1 | import Dispatch 2 | import Foundation 3 | #if os(Android) 4 | import FoundationNetworking 5 | #endif 6 | 7 | public class HelloMessage { 8 | 9 | public init() { 10 | } 11 | 12 | public func execute() { 13 | 14 | // ~~~~~~~~~~~~~~ CORE 15 | print("SA - SwiftCore: Works!") 16 | 17 | // ~~~~~~~~~~~~~~ DISPATCH 18 | let sema = DispatchSemaphore(value: 0) 19 | 20 | let queue = DispatchQueue(label: "queueName") 21 | queue.async { 22 | print("SA - DispatchQueue: Works!") 23 | sema.signal() 24 | } 25 | 26 | if sema.wait(timeout: .now() + 10) == .timedOut { 27 | print("SA - DispatchQueue: Timeout.") 28 | } 29 | 30 | // ~~~~~~~~~~~~~~ FOUNDATION 31 | let op = BlockOperation { 32 | print("SA - BlockOperation: Works!") 33 | } 34 | let opQueue = OperationQueue() 35 | opQueue.addOperations([op], waitUntilFinished: true) 36 | 37 | // ~~~~~~~~~~~~~~~~ Serialization 38 | let json = ["name": "SA - JSONSerialization/JSONDecoder: Works!"] 39 | do { 40 | let data = try JSONSerialization.data(withJSONObject: json, options: []) 41 | struct Person: Decodable { 42 | let name: String 43 | } 44 | 45 | let person = try JSONDecoder().decode(Person.self, from: data) 46 | print(person.name) 47 | 48 | } catch { 49 | print(error) 50 | } 51 | 52 | let config = URLSessionConfiguration.default 53 | let session = URLSession(configuration: config) 54 | if let url = URL(string: "http://www.example.com") { 55 | let sema2 = DispatchSemaphore(value: 0) 56 | let task = session.dataTask(with: url) { data, response, error in 57 | if let response = response { 58 | print("Response: \(response)") 59 | } 60 | if let error = error { 61 | print("Error: \(error)") 62 | } 63 | if let data = data { 64 | print(data) 65 | } 66 | sema2.signal() 67 | } 68 | print("URL Task: \(task)") 69 | task.resume() 70 | if sema2.wait(timeout: .now() + 10) == .timedOut { 71 | print("~~~~~~") 72 | } 73 | } else { 74 | print("bad url") 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/SAConcurrency/SAConcurrencyMain.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // 4 | // 5 | // Created by Vlad Gorlov on 01.01.22. 6 | // 7 | 8 | import Foundation 9 | 10 | public class SAConcurrencyMain { 11 | 12 | public init() { 13 | print("SA - Concurrency: Init") 14 | } 15 | 16 | public func execute(completion: @escaping () -> Void) { 17 | print("SA - Concurrency: Start") 18 | Task { 19 | let task = Task.detached(priority: .userInitiated) { () -> Int in 20 | let urls = await self.getURLs() 21 | return urls.count 22 | } 23 | let value = await task.value 24 | print("SA - Concurrency: Got \(value) urls.") 25 | print("SA - Concurrency: End") 26 | completion() 27 | } 28 | } 29 | 30 | private func getURLs() async -> [String] { 31 | Thread.sleep(forTimeInterval: 1) 32 | return ["https://docs.swift.org/", "https://google.com/", "https://ibm.com/"] 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Tests/sample-pkg/Sources/StdLib/FILE.swift: -------------------------------------------------------------------------------- 1 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 2 | import Darwin 3 | #elseif os(Windows) 4 | import MSVCRT 5 | #else 6 | import Glibc 7 | #endif 8 | 9 | func test() { 10 | 11 | tolower(5) // sysroot/usr/include/ctype.h 12 | fesetround(6) // sysroot/usr/include/fenv.h 13 | localeconv() // sysroot/usr/include/locale.h 14 | #if os(Android) 15 | isnan(7) // sysroot/usr/include/math.h 16 | #endif 17 | 18 | #if os(Android) 19 | _ = Glibc.stderr! 20 | _ = Glibc.stdout! 21 | #endif 22 | 23 | _ = FOPEN_MAX 24 | 25 | //> sysroot/usr/include/stdio.h 26 | _ = off_t() 27 | _ = FILE() 28 | // _ = __sFILE() 29 | clearerr(nil) 30 | fclose(nil) 31 | //< 32 | 33 | #if os(Android) 34 | _ = __ANDROID_API_Q__ // sysroot/usr/include/android/api-level.h 35 | #endif 36 | 37 | let file: UnsafeMutablePointer? = nil 38 | _ = file 39 | } 40 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.78 2 | -------------------------------------------------------------------------------- /lib/Archs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var HostArch = require("./Archs/HostArch"); 26 | var ArmArch = require("./Archs/ArmArch"); 27 | var Arm64Arch = require("./Archs/Arm64Arch"); 28 | var x86Arch = require("./Archs/x86Arch"); 29 | var x86_64Arch = require("./Archs/x86_64Arch"); 30 | 31 | module.exports = { 32 | host: new HostArch(), 33 | arm: new ArmArch(), 34 | arm64: new Arm64Arch(), 35 | x86: new x86Arch(), 36 | x86_64: new x86_64Arch(), 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Archs/Arch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | module.exports = class Arch { 26 | constructor() { 27 | this.name = ""; 28 | /** Used inside `cmake` configurations. */ 29 | this.ndkABI = ""; 30 | this.ndkPlatform = ""; 31 | this.ndkLibArchName = ""; 32 | this.swiftArch = ""; 33 | this.swiftTarget = ""; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /lib/Archs/Arm64Arch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Arch = require("./Arch"); 26 | 27 | module.exports = class Arm64Arch extends Arch { 28 | constructor() { 29 | super(); 30 | this.name = "aarch64"; 31 | this.ndkABI = "arm64-v8a"; 32 | this.ndkPlatform = "arch-arm64"; 33 | this.ndkLibArchName = "aarch64-linux-android"; 34 | this.swiftArch = "aarch64"; 35 | this.swiftTarget = "aarch64-unknown-linux-android"; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Archs/ArmArch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Arch = require("./Arch"); 26 | 27 | module.exports = class ArmArch extends Arch { 28 | constructor() { 29 | super(); 30 | this.name = "armv7a"; 31 | this.ndkABI = "armeabi-v7a"; 32 | this.ndkPlatform = "arch-arm"; 33 | this.ndkLibArchName = "arm-linux-androideabi"; 34 | this.swiftArch = "armv7"; 35 | this.swiftTarget = "armv7-unknown-linux-androideabi"; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Archs/HostArch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Arch = require("./Arch"); 26 | 27 | module.exports = class HostArch extends Arch { 28 | constructor() { 29 | super() 30 | this.name = "host" 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /lib/Archs/x86Arch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Arch = require("./Arch"); 26 | 27 | module.exports = class x86Arch extends Arch { 28 | constructor() { 29 | super(); 30 | this.name = "x86"; 31 | this.ndkABI = "x86"; 32 | this.ndkPlatform = "arch-x86"; 33 | this.ndkLibArchName = "i686-linux-android"; 34 | this.swiftArch = "i686"; 35 | this.swiftTarget = "i686-unknown-linux-android"; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Archs/x86_64Arch.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Arch = require("./Arch"); 26 | 27 | module.exports = class x86_64Arch extends Arch { 28 | constructor() { 29 | super(); 30 | this.name = "x86_64"; 31 | this.ndkABI = "x86_64"; 32 | this.ndkPlatform = "arch-x86_64"; 33 | this.ndkLibArchName = "x86_64-linux-android"; 34 | this.swiftArch = "x86_64"; 35 | this.swiftTarget = "x86_64-unknown-linux-android"; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Builders/CMarkBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | module.exports = class CMarkBuilder extends Builder { 30 | constructor() { 31 | super(Component.cmark, Archs.host); 32 | } 33 | 34 | // See: $SWIFT_REPO/docs/WindowsBuild.md 35 | executeConfigure() { 36 | var cFlags = '-Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector' 37 | var cmd = ` 38 | cd ${this.paths.builds} && cmake 39 | -G Ninja 40 | -D CMAKE_INSTALL_PREFIX=/ 41 | -D CMAKE_BUILD_TYPE=Release 42 | -D CMARK_TESTS=false 43 | -D CMAKE_C_FLAGS="${cFlags}" 44 | -D CMAKE_CXX_FLAGS="${cFlags}" 45 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 46 | -D CMAKE_OSX_SYSROOT=${this.paths.xcMacOsSdkPath} 47 | ${this.paths.sources} 48 | `; 49 | this.executeCommands(cmd); 50 | } 51 | 52 | executeBuild() { 53 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 54 | } 55 | 56 | executeInstall() { 57 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 58 | } 59 | }; 60 | -------------------------------------------------------------------------------- /lib/Builders/ICUBaseBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Arch = require("../Archs/Arch"); 28 | var path = require("path"); 29 | 30 | module.exports = class ICUBaseBuilder extends Builder { 31 | constructor(/** @type {Arch} */ arch) { 32 | super(Component.icu, arch); 33 | this.paths.sources = path.join(this.paths.sources, 'icu4c') 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /lib/Builders/ICUHostBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var ICUBaseBuilder = require("./ICUBaseBuilder"); 26 | const Archs = require("../Archs"); 27 | 28 | module.exports = class ICUHostBuilder extends ICUBaseBuilder { 29 | constructor() { 30 | super(Archs.host); 31 | } 32 | 33 | executeConfigure() { 34 | var hostSystem = "MacOSX"; // Other option "Linux" 35 | 36 | var cmd = `cd ${this.paths.builds} && 37 | CFLAGS='-Os' 38 | CXXFLAGS='--std=c++11' 39 | ${this.paths.sources}/source/runConfigureICU ${hostSystem} --prefix=${this.paths.installs} 40 | 41 | // Below option should not be set. Otherwize you will have ICU without embed data. 42 | // See: 43 | // - ICU Data - ICU User Guide: http://userguide.icu-project.org/icudata#TOC-Building-and-Linking-against-ICU-data 44 | // - https://forums.swift.org/t/partial-nightlies-for-android-sdk/25909/43?u=v.gorlov 45 | // --enable-tools=no 46 | 47 | --enable-static --enable-shared=no --enable-extras=no --enable-strict=no --enable-icuio=no --enable-layout=no 48 | --enable-layoutex=no --enable-tests=no --enable-samples=no --enable-dyload=no 49 | `; 50 | this.executeCommands(cmd); 51 | } 52 | 53 | executeBuild() { 54 | this.execute(`cd ${this.paths.builds} && make`); 55 | } 56 | 57 | executeInstall() { 58 | this.logInfo("ICU Host Build not require to install. It is just used for `Cross Compilation`."); 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /lib/Builders/SAPBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | module.exports = class SAPBuilder extends Builder { 30 | constructor() { 31 | super(Component.sap, Archs.host); 32 | } 33 | 34 | executeConfigure() { 35 | var cmd = ` 36 | cd ${this.paths.builds} && cmake 37 | -G Ninja 38 | -D CMAKE_INSTALL_PREFIX=/ 39 | -D CMAKE_BUILD_TYPE=Release 40 | -D BUILD_SHARED_LIBS=YES 41 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 42 | -D BUILD_EXAMPLES=FALSE 43 | -D BUILD_TESTING=FALSE 44 | ${this.paths.sources} 45 | `; 46 | this.executeCommands(cmd); 47 | } 48 | 49 | executeBuild() { 50 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 51 | } 52 | 53 | executeInstall() { 54 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /lib/Builders/SSLBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Arch = require("../Archs/Arch"); 28 | var NDK = require("../NDK"); 29 | var Archs = require("../Archs"); 30 | 31 | module.exports = class SSLBuilder extends Builder { 32 | constructor(/** @type {Arch} */ arch) { 33 | super(Component.ssl, arch); 34 | var ndk = new NDK(); 35 | this.options = `ANDROID_NDK=${ndk.sources} PATH=${ndk.toolchainPath}/bin:$PATH`; 36 | } 37 | 38 | prepare() { 39 | // Unused at the moment. 40 | } 41 | 42 | executeConfigure() { 43 | this.clean(); 44 | 45 | // For troubleshooting run: `cd ToolChain/Sources/ssl/ && perl configdata.pm --dump` 46 | 47 | var ndk = new NDK(); 48 | var cmd = ` 49 | ${this.options} 50 | ./Configure 51 | -D__ANDROID_API__=${ndk.api} 52 | --prefix=${this.paths.installs} 53 | `; 54 | if (this.arch.name == Archs.arm.name) { 55 | cmd = `${cmd} android-arm`; 56 | } else if (this.arch.name == Archs.arm64.name) { 57 | cmd = `${cmd} android-arm64`; 58 | } else if (this.arch.name == Archs.x86.name) { 59 | cmd = `${cmd} android-x86`; 60 | } else if (this.arch.name == Archs.x86_64.name) { 61 | cmd = `${cmd} android-x86_64`; 62 | } 63 | this.executeCommands(`cd ${this.paths.sources} && ${cmd}`); 64 | } 65 | 66 | executeBuild() { 67 | this.executeCommands(`cd ${this.paths.sources} && ${this.options} make SHLIB_VERSION_NUMBER= SHLIB_EXT=.so`); 68 | } 69 | 70 | executeInstall() { 71 | this.executeCommands( 72 | `cd ${this.paths.sources} && ${this.options} make SHLIB_VERSION_NUMBER= SHLIB_EXT=.so install_sw install_ssldirs` 73 | ); 74 | } 75 | 76 | get libs() { 77 | return this.findLibs(`${this.paths.installs}/lib`) 78 | } 79 | }; 80 | -------------------------------------------------------------------------------- /lib/Builders/SwiftCryptoBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | module.exports = class SwiftCryptoBuilder extends Builder { 30 | constructor() { 31 | super(Component.sc, Archs.host); 32 | } 33 | 34 | executeConfigure() { 35 | var cmd = ` 36 | cd ${this.paths.builds} && cmake 37 | -G Ninja 38 | -D CMAKE_INSTALL_PREFIX=/ 39 | -D CMAKE_BUILD_TYPE=Release 40 | 41 | # Needed due issue "Ignoring CMAKE_OSX_SYSROOT value" See: https://discourse.cmake.org/t/specifying-cmake-osx-sysroot-breaks-xcode-projects-but-no-other-choice/2532 42 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 43 | ${this.paths.sources} 44 | `; 45 | this.executeCommands(cmd); 46 | } 47 | 48 | executeBuild() { 49 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 50 | } 51 | 52 | executeInstall() { 53 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /lib/Builders/SwiftDriverBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | var SwiftTSCBuilder = require("./SwiftTSCBuilder"); 30 | var LLBBuilder = require("./LLBBuilder"); 31 | var YAMSBuilder = require("./YAMSBuilder"); 32 | var SAPBuilder = require("./SAPBuilder"); 33 | 34 | module.exports = class SwiftDriverBuilder extends Builder { 35 | constructor() { 36 | super(Component.sd, Archs.host); 37 | } 38 | 39 | // See: https://github.com/apple/swift-driver#building-with-cmake 40 | executeConfigure() { 41 | const tsc = new SwiftTSCBuilder() 42 | const llb = new LLBBuilder() 43 | const yams = new YAMSBuilder() 44 | const sap = new SAPBuilder() 45 | var cmd = ` 46 | cd ${this.paths.builds} && cmake 47 | -G Ninja 48 | -D CMAKE_INSTALL_PREFIX=/ 49 | -D CMAKE_BUILD_TYPE=Release 50 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 51 | 52 | -D TSC_DIR=${tsc.paths.builds}/cmake/modules 53 | -D LLBuild_DIR=${llb.paths.builds}/cmake/modules 54 | -D Yams_DIR=${yams.paths.builds}/cmake/modules 55 | -D ArgumentParser_DIR=${sap.paths.builds}/cmake/modules 56 | 57 | ${this.paths.sources} 58 | `; 59 | this.executeCommands(cmd); 60 | } 61 | 62 | executeBuild() { 63 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 64 | } 65 | 66 | executeInstall() { 67 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 68 | } 69 | }; 70 | -------------------------------------------------------------------------------- /lib/Builders/SwiftTSCBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | module.exports = class SwiftTSCBuilder extends Builder { 30 | constructor() { 31 | super(Component.tsc, Archs.host); 32 | } 33 | 34 | // See: ToolChain/Sources/spm/Utilities/build-using-cmake 35 | executeConfigure() { 36 | var cmd = ` 37 | cd ${this.paths.builds} && cmake 38 | -G Ninja 39 | -D CMAKE_BUILD_TYPE=Release 40 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 41 | -D CMAKE_INSTALL_PREFIX=/ 42 | -D CMAKE_Swift_FLAGS="-sdk ${this.paths.xcMacOsSdkPath}" 43 | ${this.paths.sources} 44 | `; 45 | this.executeCommands(cmd); 46 | } 47 | 48 | executeBuild() { 49 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 50 | } 51 | 52 | executeInstall() { 53 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 54 | } 55 | 56 | configurePatches(/** @type {Boolean} */ shouldEnable) { 57 | //> Below not needed starting from v1.0.69 58 | // this.configurePatch(`${this.paths.patches}/Sources/TSCBasic/CMakeLists.txt.diff`, shouldEnable) 59 | // this.configurePatch(`${this.paths.patches}/Sources/TSCLibc/CMakeLists.txt.diff`, shouldEnable) 60 | // this.configurePatch(`${this.paths.patches}/Sources/TSCUtility/CMakeLists.txt.diff`, shouldEnable) 61 | //< 62 | } 63 | }; 64 | -------------------------------------------------------------------------------- /lib/Builders/YAMSBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Builder = require("../Builder"); 26 | var Component = require("../Components"); 27 | var Archs = require("../Archs"); 28 | 29 | module.exports = class YAMSBuilder extends Builder { 30 | constructor() { 31 | super(Component.yams, Archs.host); 32 | } 33 | 34 | // See: https://github.com/jpsim/Yams#cmake 35 | executeConfigure() { 36 | var cmd = ` 37 | cd ${this.paths.builds} && cmake 38 | -G Ninja 39 | -D CMAKE_INSTALL_PREFIX=/ 40 | -D CMAKE_BUILD_TYPE=Release 41 | -D CMAKE_OSX_DEPLOYMENT_TARGET=10.15 42 | ${this.paths.sources} 43 | `; 44 | this.executeCommands(cmd); 45 | } 46 | 47 | executeBuild() { 48 | this.execute(`cd ${this.paths.builds} && ninja -j${this.numberOfJobs}`); 49 | } 50 | 51 | executeInstall() { 52 | this.execute(`DESTDIR=${this.paths.installs} cmake --build ${this.paths.builds} --target install`); 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /lib/Components.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | const LLVMComponent = require("./Components/LLVMComponent"); 26 | const SwiftStdLibComponent = require("./Components/SwiftStdLibComponent"); 27 | const ICUCompoment = require("./Components/ICUCompoment"); 28 | const SwiftComponent = require("./Components/SwiftComponent"); 29 | const CMarkComponent = require("./Components/CMarkComponent"); 30 | const DispatchComponent = require("./Components/DispatchComponent"); 31 | const FoundationComponent = require("./Components/FoundationComponent"); 32 | const XMLComponent = require("./Components/XMLComponent"); 33 | const CURLComponent = require("./Components/CURLComponent"); 34 | const SSLComponent = require("./Components/SSLComponent"); 35 | const SPMComponent = require("./Components/SPMComponent"); 36 | const LLBComponent = require("./Components/LLBComponent"); 37 | const SwiftTSCComponent = require("./Components/SwiftTSCComponent"); 38 | const SAPComponent = require("./Components/SAPComponent"); 39 | const YAMSComponent = require("./Components/YAMSComponent"); 40 | const SwiftDriverComponent = require("./Components/SwiftDriverComponent"); 41 | const SwiftCryptoComponent = require("./Components/SwiftCryptoComponent"); 42 | 43 | module.exports = { 44 | llvm: new LLVMComponent(), 45 | stdlib: new SwiftStdLibComponent(), 46 | icu: new ICUCompoment(), 47 | swift: new SwiftComponent(), 48 | cmark: new CMarkComponent(), 49 | dispatch: new DispatchComponent(), 50 | foundation: new FoundationComponent(), 51 | xml: new XMLComponent(), 52 | curl: new CURLComponent(), 53 | ssl: new SSLComponent(), 54 | spm: new SPMComponent(), 55 | llb: new LLBComponent(), 56 | tsc: new SwiftTSCComponent(), 57 | sap: new SAPComponent(), 58 | yams: new YAMSComponent(), 59 | sd: new SwiftDriverComponent(), 60 | sc: new SwiftCryptoComponent(), 61 | }; 62 | -------------------------------------------------------------------------------- /lib/Components/CMarkComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class CMarkComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "cmark" 33 | this.name = "cmark" 34 | this.revision = Revision.cmark 35 | this.repository = Repo.cmark 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/CURLComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class CURLComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "curl" 33 | this.name = "curl" 34 | this.revision = Revision.curl 35 | this.repository = Repo.curl 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/Component.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | module.exports = class Component { 26 | constructor() { 27 | this.sources = ""; 28 | this.name = ""; 29 | this.revision = ""; 30 | this.repository = ""; 31 | this.patches = ""; 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /lib/Components/DispatchComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class DispatchComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "swift-corelibs-libdispatch" 33 | this.name = "swift-corelibs-libdispatch" 34 | this.revision = Revision.dispatch 35 | this.repository = Repo.dispatch 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/FoundationComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class FoundationComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "swift-corelibs-foundation" 33 | this.name = "swift-corelibs-foundation" 34 | this.revision = Revision.foundation 35 | this.repository = Repo.foundation 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/ICUCompoment.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class ICUCompoment extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "icu" 33 | this.name = "icu" 34 | this.revision = Revision.icu 35 | this.repository = Repo.icu 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/LLBComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class LLBComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "llbuild"; 33 | this.name = "llbuild"; 34 | this.revision = Revision.llb; 35 | this.repository = Repo.llb; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/LLVMComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class LLVMComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "llvm-project" 33 | this.name = "llvm-project" 34 | this.revision = Revision.llvm 35 | this.repository = Repo.llvm 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SAPComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SAPComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "swift-argument-parser"; 33 | this.name = "swift-argument-parser"; 34 | this.revision = Revision.sap; 35 | this.repository = Repo.sap; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SPMComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SPMComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "spm"; 33 | this.name = "spm"; 34 | this.revision = Revision.spm; 35 | this.repository = Repo.spm; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SSLComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SSLCompoment extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "ssl" 33 | this.name = "ssl" 34 | this.revision = Revision.ssl 35 | this.repository = Repo.ssl 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SwiftComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SwiftComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "swift" 33 | this.name = "swift" 34 | this.revision = Revision.swift 35 | this.repository = Repo.swift 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SwiftCryptoComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SwiftCryptoComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "swift-crypto"; 33 | this.name = "swift-crypto"; 34 | this.revision = Revision.sc; 35 | this.repository = Repo.sc; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SwiftDriverComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SwiftDriverComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "swift-driver" 33 | this.name = "swift-driver" 34 | this.revision = Revision.sd 35 | this.repository = Repo.sd 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SwiftStdLibComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SwiftStdLibComponent extends Component { 30 | constructor() { 31 | super() 32 | this.sources = "swift" 33 | this.name = "swift-stdlib" 34 | this.revision = Revision.swift 35 | this.repository = Repo.swift 36 | this.patches = "swift"; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/SwiftTSCComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class SwiftTSCComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "swift-tools-support-core"; 33 | this.name = "swift-tools-support-core"; 34 | this.revision = Revision.tsc; 35 | this.repository = Repo.tsc; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/XMLComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class XMLComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "xml"; 33 | this.name = "xml"; 34 | this.revision = Revision.xml; 35 | this.repository = Repo.xml; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Components/YAMSComponent.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Component = require("./Component"); 26 | var Revision = require("../Git/Revision"); 27 | var Repo = require("../Git/Repo"); 28 | 29 | module.exports = class YAMSComponent extends Component { 30 | constructor() { 31 | super(); 32 | this.sources = "yams"; 33 | this.name = "yams"; 34 | this.revision = Revision.yams; 35 | this.repository = Repo.yams; 36 | this.patches = this.name; 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /lib/Config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var path = require("path"); 26 | var Location = require("./Location"); 27 | 28 | var projectDirPath = path.dirname(path.resolve(__dirname)); 29 | 30 | module.exports = { 31 | root: projectDirPath, 32 | toolChain: path.join(projectDirPath, Location.toolChain), 33 | toolChainBuildOutput: path.join(projectDirPath, Location.toolChain, "swift-android-toolchain"), 34 | tests: path.join(projectDirPath, Location.tests), 35 | }; 36 | -------------------------------------------------------------------------------- /lib/Folder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | module.exports = { 26 | sources: "Sources", 27 | patches: "Patches", 28 | install: "Install", 29 | build: "Build", 30 | }; 31 | -------------------------------------------------------------------------------- /lib/Git/Repo.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | // See also: $ToolChain/Sources/swift/utils/update_checkout/update-checkout-config.json 26 | 27 | module.exports = { 28 | swift: "https://github.com/apple/swift.git", 29 | dispatch: "https://github.com/apple/swift-corelibs-libdispatch.git", 30 | foundation: "https://github.com/apple/swift-corelibs-foundation.git", 31 | llvm: "https://github.com/apple/llvm-project.git", 32 | cmark: "https://github.com/apple/swift-cmark.git", 33 | ssl: "https://github.com/openssl/openssl.git", 34 | icu: "https://github.com/unicode-org/icu.git", 35 | curl: "https://github.com/curl/curl.git", 36 | xml: "https://github.com/GNOME/libxml2.git", 37 | spm: "https://github.com/apple/swift-package-manager.git", 38 | llb: "https://github.com/apple/swift-llbuild.git", 39 | tsc: "https://github.com/apple/swift-tools-support-core.git", 40 | sap: "https://github.com/apple/swift-argument-parser", 41 | yams: "https://github.com/jpsim/Yams", 42 | sd: "https://github.com/apple/swift-driver", 43 | sc: "https://github.com/apple/swift-crypto", 44 | }; 45 | -------------------------------------------------------------------------------- /lib/Location.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | module.exports = { 26 | patches: "Patches", 27 | toolChain: "ToolChain", 28 | tests: "Tests", 29 | }; 30 | -------------------------------------------------------------------------------- /lib/NDK.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Settings = require("./Settings"); 26 | var path = require("path"); 27 | 28 | module.exports = class NDK { 29 | constructor() { 30 | this.api = 21; 31 | this.platformName = `android-${this.api}`; 32 | this.sources = Settings.ndkDir; 33 | this.toolchainPath = path.join(Settings.ndkDir, 'toolchains/llvm/prebuilt/darwin-x86_64') 34 | this.gcc = "4.9" 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /lib/Paths.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var path = require("path"); 26 | const cp = require("child_process"); 27 | 28 | var Config = require("./Config"); 29 | var Folder = require("./Folder"); 30 | var Component = require("./Components/Component"); 31 | var Arch = require("./Archs/Arch"); 32 | 33 | module.exports = class Paths { 34 | static sourcesDirPath(/** @type {Component} */ component) { 35 | return path.join(Config.toolChain, Folder.sources, component.sources); 36 | } 37 | constructor(/** @type {String} */ platform, /** @type {Component} */ component, /** @type {Arch} */ arch) { 38 | this.sources = Paths.sourcesDirPath(component) 39 | this.patches = path.join(Config.root, Folder.patches, component.patches); 40 | this.builds = path.join(Config.toolChain, Folder.build, `${platform}-${arch.name}`, component.name); 41 | this.installs = path.join(Config.toolChain, Folder.install, `${platform}-${arch.name}`, component.name); 42 | this.lib = path.join(this.installs, 'lib') 43 | this.developerDir = cp.execSync("xcode-select --print-path").toString().trim() 44 | this.xcToolchainPath = path.join(this.developerDir, 'Toolchains/XcodeDefault.xctoolchain') 45 | this.xcMacOsSdkPath = path.join(this.developerDir, 'Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk') // The `xcrun --show-sdk-path` can be used instead. 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /lib/Settings.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var path = require("path"); 26 | const Config = require("./Config"); 27 | var fs = require("fs"); 28 | 29 | const ndkVersion = fs.readFileSync(path.join(Config.root, "NDK_VERSION"), "utf8").toString().trim(); 30 | const toolchainVersion = fs.readFileSync(path.join(Config.root, "VERSION"), "utf8").toString().trim() 31 | const ndkPath = `/usr/local/ndk/${ndkVersion}` 32 | var absoluteNDKPath = ndkPath 33 | const isNDKPathASymbolicLink = fs.lstatSync(path.resolve(ndkPath)).isSymbolicLink() 34 | if(isNDKPathASymbolicLink) { 35 | absoluteNDKPath = fs.readlinkSync(ndkPath) 36 | } 37 | 38 | module.exports = { 39 | version: toolchainVersion, 40 | ndkVersion: ndkVersion, 41 | ndkDir: absoluteNDKPath, 42 | sharedNDKDirPath: ndkPath 43 | }; 44 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License 3 | * 4 | * Copyright (c) 2019 Volodymyr Gorlov (https://github.com/vgorloff) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | var Automation = require("./Automation") 26 | new Automation().run() 27 | --------------------------------------------------------------------------------