]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - htsn-import.cabal
Update makefile/cabalfile with better profiling support.
[dead/htsn-import.git] / htsn-import.cabal
1 name: htsn-import
2 version: 0.0.1
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 category: Utils
7 license: GPL-3
8 license-file: doc/LICENSE
9 build-type: Simple
10 extra-source-files:
11 doc/htsnrc-import.example
12 doc/man1/htsn-import.1
13 makefile
14 test/xml/*.xml
15 schema/*.dtd
16 schemagen/*/*.xml
17 synopsis:
18 Import XML files from The Sports Network into an RDBMS.
19 description:
20 /Usage/:
21 .
22 @
23 htsn-import [OPTIONS] [FILES]
24 @
25 .
26 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
27 containing various sports news and statistics. Our sister program
28 /htsn/ is capable of retrieving the feed and saving the individual
29 XML documents contained therein. But what to do with them?
30 .
31 The purpose of /htsn-import/ is to take these XML documents and
32 get them into something we can use, a relational database management
33 system (RDBMS), loosely known as a SQL database. The structure of
34 relational database, is, well, relational, and the feed XML is not. So
35 there is some work to do before the data can be inserted.
36 .
37 First, we must parse the XML. Each supported document type (see below)
38 has a full pickle/unpickle implementation (\"pickle\" is simply a
39 synonym for serialize here). That means that we parse the entire
40 document into a data structure, and if we pickle (serialize) that data
41 structure, we get the exact same XML document tha we started with.
42 .
43 This is important for two reasons. First, it serves as a second level
44 of validation. The first validation is performed by the XML parser,
45 but if that succeeds and unpicking fails, we know that something is
46 fishy. Second, we don't ever want to be surprised by some new element
47 or attribute showing up in the XML. The fact that we can unpickle the
48 whole thing now means that we won't be surprised in the future.
49 .
50 The aforementioned feature is especially important because we
51 automatically migrate the database schema every time we import a
52 document. If you attempt to import a \"newsxml.dtd\" document, all
53 database objects relating to the news will be created if they do not
54 exist. We don't want the schema to change out from under us without
55 warning, so it's important that no XML be parsed that would result in
56 a different schema than we had previously. Since we can
57 pickle/unpickle everything already, this should be impossible.
58 .
59 Examples and usage documentation are available in the man page.
60
61 executable htsn-import
62 build-depends:
63 base == 4.*,
64 cmdargs >= 0.10.6,
65 configurator == 0.2.*,
66 directory == 1.2.*,
67 filepath == 1.3.*,
68 hslogger == 1.2.*,
69 htsn-common == 0.0.1,
70 hxt == 9.3.*,
71 groundhog == 0.4.*,
72 groundhog-postgresql == 0.4.*,
73 groundhog-sqlite == 0.4.*,
74 groundhog-th == 0.4.*,
75 MissingH == 1.2.*,
76 old-locale == 1.0.*,
77 tasty == 0.7.*,
78 tasty-hunit == 0.4.*,
79 time == 1.4.*,
80 transformers == 0.3.*,
81 tuple == 0.2.*
82
83 main-is:
84 Main.hs
85
86 hs-source-dirs:
87 src/
88
89 other-modules:
90 Backend
91 CommandLine
92 Configuration
93 ConnectionString
94 ExitCodes
95 OptionalConfiguration
96 TSN.Codegen
97 TSN.DbImport
98 TSN.Picklers
99 TSN.XmlImport
100 TSN.XML.Heartbeat
101 TSN.XML.Injuries
102 TSN.XML.InjuriesDetail
103 TSN.XML.News
104 TSN.XML.Odds
105 Xml
106
107 ghc-options:
108 -Wall
109 -fwarn-hi-shadowing
110 -fwarn-missing-signatures
111 -fwarn-name-shadowing
112 -fwarn-orphans
113 -fwarn-type-defaults
114 -fwarn-tabs
115 -fwarn-incomplete-record-updates
116 -fwarn-monomorphism-restriction
117 -fwarn-unused-do-bind
118 -rtsopts
119 -threaded
120 -optc-O3
121 -optc-march=native
122 -O2
123
124 ghc-prof-options:
125 -prof
126 -fprof-auto
127 -fprof-cafs
128 -- The following unbreak profiling with template haskell. We have
129 -- to build the program twice; once without profile and again with
130 -- these flags.
131 -hisuf hi_p
132 -osuf o_p
133
134
135 test-suite testsuite
136 type: exitcode-stdio-1.0
137 hs-source-dirs: src test
138 main-is: TestSuite.hs
139 build-depends:
140 base == 4.*,
141 cmdargs >= 0.10.6,
142 configurator == 0.2.*,
143 directory == 1.2.*,
144 filepath == 1.3.*,
145 hslogger == 1.2.*,
146 htsn-common == 0.0.1,
147 hxt == 9.3.*,
148 groundhog == 0.4.*,
149 groundhog-postgresql == 0.4.*,
150 groundhog-sqlite == 0.4.*,
151 groundhog-th == 0.4.*,
152 MissingH == 1.2.*,
153 old-locale == 1.0.*,
154 tasty == 0.7.*,
155 tasty-hunit == 0.4.*,
156 time == 1.4.*,
157 transformers == 0.3.*,
158 tuple == 0.2.*
159
160 -- It's not entirely clear to me why I have to reproduce all of this.
161 ghc-options:
162 -Wall
163 -fwarn-hi-shadowing
164 -fwarn-missing-signatures
165 -fwarn-name-shadowing
166 -fwarn-orphans
167 -fwarn-type-defaults
168 -fwarn-tabs
169 -fwarn-incomplete-record-updates
170 -fwarn-monomorphism-restriction
171 -fwarn-unused-do-bind
172 -rtsopts
173 -threaded
174 -optc-O3
175 -optc-march=native
176 -O2
177
178
179 test-suite doctests
180 type: exitcode-stdio-1.0
181 hs-source-dirs: test
182 main-is: Doctests.hs
183 build-depends:
184 base == 4.*,
185 -- Additional test dependencies.
186 doctest == 0.9.*
187
188 -- It's not entirely clear to me why I have to reproduce all of this.
189 ghc-options:
190 -Wall
191 -fwarn-hi-shadowing
192 -fwarn-missing-signatures
193 -fwarn-name-shadowing
194 -fwarn-orphans
195 -fwarn-type-defaults
196 -fwarn-tabs
197 -fwarn-incomplete-record-updates
198 -fwarn-monomorphism-restriction
199 -fwarn-unused-do-bind
200 -rtsopts
201 -threaded
202 -optc-O3
203 -optc-march=native
204 -O2
205
206
207 source-repository head
208 type: git
209 location: http://michael.orlitzky.com/git/htsn-import.git
210 branch: master