Skip to content

Commit

Permalink
Update to Swift 4 package format
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Dec 12, 2018
1 parent d1fd237 commit ae62ee2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
14 changes: 11 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
// swift-tools-version:4.0

import PackageDescription

let package = Package(
name: "Atk",
products: [
.library(name: "Atk", targets: ["Atk"]),
],
dependencies: [
.Package(url: "https://github.com/rhx/CAtk.git", majorVersion: 1),
.Package(url: "https://github.com/rhx/SwiftGObject.git", majorVersion: 2)
.package(url: "https://github.com/rhx/CAtk.git", .branch("master")),
.package(url: "https://github.com/rhx/SwiftGObject.git", .branch("master"))
],
swiftLanguageVersions: [3, 4]
targets: [
.target(name: "Atk", dependencies: ["GLibObject"]),
.testTarget(name: "AtkTests", dependencies: ["Atk"]),
]
)
File renamed without changes.
5 changes: 3 additions & 2 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Configuration for the module to compile, the Swift toolchain, and
# the compiler and linker flags to use.
#
Mod=Atk
Module=${Mod}-1.0
VER=1.0
Mod=`grep name: Package.swift | head -n1 | cut -d'"' -f2`
Module=${Mod}-${VER}
module=`echo "${Module}" | tr '[:upper:]' '[:lower:]'`
mod=`echo "${Mod}" | tr '[:upper:]' '[:lower:]'`
BUILD_DIR=`pwd`/.build
Expand Down
2 changes: 1 addition & 1 deletion distclean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#
. ./config.sh
./clean.sh
exec rm -rf Package.pins Packages Sources/${Module}.swift Sources/Swift${Mod}.swift ${Mod}.xcodeproj
exec rm -rf Package.pins Packages Sources/${Mod}/${Module}.swift Sources/${Mod}/Swift${Mod}.swift ${Mod}.xcodeproj
4 changes: 2 additions & 2 deletions gir-to-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if [ ! -e "${GIR}" ] ; then
echo "and can be found in /usr /usr/local or by pkg-config!"
exit 1
fi
gir2swift -o Sources -m ${Module}.module -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GModule-2.0.gir -p ${GIR_DIR}/Gio-2.0.gir "${GIR}"
for src in Sources/*-*.swift ; do
gir2swift -o Sources/${Mod} -m ${Module}.module -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/GModule-2.0.gir -p ${GIR_DIR}/Gio-2.0.gir "${GIR}"
for src in Sources/${Mod}/*-*.swift ; do
sed -f ${Module}.sed < ${src} > ${src}.out
mv ${src}.out ${src}
done
2 changes: 1 addition & 1 deletion xcodegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# and pass them to subprojects, based on the configured -I flags.
#
. ./config.sh
[ -e Sources/${Module}.swift ] || ./generate-wrapper.sh
[ -e Sources/${Mod}/${Module}.swift ] || ./generate-wrapper.sh
./package.sh generate-xcodeproj "$@"
[ ! -e ${Mod}.xcodeproj/Configs ] || \
( cd ${Mod}.xcodeproj/Configs && \
Expand Down

0 comments on commit ae62ee2

Please sign in to comment.