build.atpkg 5.07 KB
Newer Older
Drew's avatar
Drew committed
1 2
(package
 :name "Caroline"
Drew's avatar
Drew committed
3
 :version "1.1"
Drew's avatar
Drew committed
4 5
:external-packages [
    {
Drew's avatar
Drew committed
6
      :version [">=1.1"]
Drew's avatar
Drew committed
7 8 9
      :url "https://code.sealedabstract.com/drewcrawford/StandBack.git"
    }
  ]
Drew's avatar
Drew committed
10 11 12 13 14
    :tasks {
        :statictool {
            :tool "atllbuild"
            :output-type "executable"
            :name "caroline_static_tool"
15
            :executable-name "caroline-static-tool"
Drew's avatar
Drew committed
16 17
            :sources ["caroline-static-tool/**.swift"]
            :publish-product true
18
            :link-options ["-static-stdlib"]
Drew's avatar
Drew committed
19 20
            :dependencies ["StandBack.default"]
            :link-with-product ["StandBack.a"]
Drew's avatar
Drew committed
21
        }
22

Drew's avatar
Drew committed
23 24 25
        :statictool-check {
            :tool "shell"
            :script "tests/caroline-static-tool-tests/test.sh"
Drew's avatar
Drew committed
26
            :dependencies ["statictool"]
Drew's avatar
Drew committed
27 28
        }

29 30 31 32 33 34 35 36 37 38 39 40 41
        :statictool-atbin {
            :tool "packageatbin"
            :name "caroline-static-tool"
            :atllbuild-task "statictool"
            :platforms ["all"]
        }
        :statictool-homebrew {
            :tool "package-homebrew.attool"
            :name "caroline-static-tool"
            :url "test-url-please-ignore-FIXME"
            :only-platforms ["osx"]
            :dependencies ["statictool-atbin"]
        }
Drew's avatar
Drew committed
42 43 44 45 46 47
        :statictool-deb {
            :tool "package-deb.attool"
            :name "caroline-static-tool"
            :dependencies ["statictool-atbin"]
            :only-platforms ["linux"]
        }
48 49
        :package-statictool {
            :tool "nop"
Drew's avatar
Drew committed
50
            :dependencies ["statictool-homebrew" "statictool-deb"]
51
        }
Drew's avatar
Drew committed
52 53 54
        :debug {
            :dependencies ["statictool"]
            :tool "shell"
Drew's avatar
Drew committed
55
            :script ".atllbuild/products/caroline-static-tool --core tests/caroline-static-tool-tests/fixtures/foo.swift"
Drew's avatar
Drew committed
56 57 58 59 60 61 62
        }
        :core {
            :tool "atllbuild"
            :output-type "static-library"
            :name "CarolineCore"
            :sources ["CarolineCore/**.swift"]
        }
Drew's avatar
Drew committed
63 64 65 66 67 68
        :core-dynamic {
            :tool "atllbuild"
            :output-type "dynamic-library"
            :name "CarolineCore"
            :sources ["CarolineCore/**.swift"]
            :publish-product true
Drew's avatar
Drew committed
69
            :framework true
Drew's avatar
Drew committed
70
        }
71 72 73 74 75 76
        :core-package {
            :tool "packageatbin"
            :name "CarolineCore"
            :atllbuild-task "core-dynamic"
            :platforms ["all"]
        }
Drew's avatar
Drew committed
77
        :core-framework {
78
            :tool "package-framework.attool"
Drew's avatar
Drew committed
79
            :name "CarolineCore"
80
            :info-plist "CarolineCore/Info.plist"
81
            :dependencies ["core-package"]
Drew's avatar
Drew committed
82
            :compress "true"
Drew's avatar
Drew committed
83
        }
Drew's avatar
Drew committed
84

Drew's avatar
Drew committed
85
        ;;simpletest is a basic sanity check of the gen/test/runner infrastructure
Drew's avatar
Drew committed
86 87
        :simpletest-gen {
            :tool "shell"
88
            :script "bin/caroline-static-tool --core tests/SimpleTest/foo.swift > tests/SimpleTest/main.swift"
Drew's avatar
Drew committed
89 90 91 92 93 94 95 96
            :dependencies ["statictool"]
        }
        :simpletest-build {
            :dependencies ["core" "simpletest-gen"]
            :tool "atllbuild"
            :output-type "executable"
            :name "SimpleTest"
            :sources ["tests/SimpleTest/**.swift"]
Drew's avatar
Drew committed
97
            :link-with-product ["CarolineCore.a"]
Drew's avatar
Drew committed
98 99 100 101 102 103 104
            :publish-product true
        }
        :simpletest {
            :dependencies ["simpletest-build"]
            :tool "shell"
            :script "bin/SimpleTest"
        }
Drew's avatar
Drew committed
105 106 107 108

        ;;coretest tests the full core API
        :coretest-gen {
            :tool "shell"
Drew's avatar
Drew committed
109
            :script "bin/caroline-static-tool --core ${collect_sources:coretest-build} > tests/CoreTests/main.swift"
Drew's avatar
Drew committed
110 111 112
            :dependencies ["statictool"]
        }
        :coretest-build {
Drew's avatar
Drew committed
113
            :dependencies ["core"]
Drew's avatar
Drew committed
114 115 116 117
            :tool "atllbuild"
            :output-type "executable"
            :name "CoreTest"
            :sources ["tests/CoreTests/**.swift"]
Drew's avatar
Drew committed
118
            :link-with-product ["CarolineCore.a"]
Drew's avatar
Drew committed
119
            :publish-product true
Drew's avatar
Drew committed
120
            :dependencies ["coretest-gen" "core"]
Drew's avatar
Drew committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
        }
        :coretest {
            :dependencies ["coretest-build"]
            :tool "shell"
            :script "bin/CoreTest"
        }
        
        ;;this alternative coretest tasks should be used with --toolchain xcode
        ;; you must also manually run coretest-gen prior to these working, as codetest-gen isn't supported on xcode toolchain
        :coretest-build-xcode {
            :dependencies ["core"]
            :tool "atllbuild"
            :output-type "executable"
            :name "CoreTest"
            :sources ["tests/CoreTests/**.swift"]
Drew's avatar
Drew committed
136
            :link-with-product ["CarolineCore.a"]
Drew's avatar
Drew committed
137 138
            :publish-product true
        }
139 140 141 142 143 144 145 146 147


        ;;we can run this via standard toolchain since we only depend on statictool
        :osx-xcode-toolrun {
            :tool "shell"
            :script "rm tests/OSXXcode/OSXXCodeTests/CarolineXCTest.swift; WRAPPER_EXTENSION=xctest PROJECT_FILE_PATH=tests/OSXXcode/OSXXcode.xcodeproj TARGETNAME=OSXXcodeTests bin/caroline-static-tool"
            :dependencies ["statictool"]
        }

Drew's avatar
Drew committed
148
        :check {
Drew's avatar
Drew committed
149
            :dependencies ["statictool-check" "simpletest" "coretest" "osx-xcode-toolrun"]
Drew's avatar
Drew committed
150 151
            :tool "nop"
        }
Drew's avatar
Drew committed
152 153
     }
)