fast_excel 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +2 -0
  3. data/.gitignore +3 -0
  4. data/.travis.yml +18 -6
  5. data/CHANGELOG.md +14 -1
  6. data/Dockerfile.test +16 -0
  7. data/Gemfile +1 -1
  8. data/Gemfile.lock +21 -21
  9. data/Makefile +13 -2
  10. data/README.md +148 -38
  11. data/Rakefile +2 -0
  12. data/examples/example.rb +3 -3
  13. data/examples/example_filters.rb +36 -0
  14. data/examples/example_formula.rb +1 -3
  15. data/examples/example_hyperlink.rb +20 -0
  16. data/fast_excel.gemspec +1 -1
  17. data/lib/fast_excel.rb +36 -12
  18. data/lib/fast_excel/binding.rb +31 -21
  19. data/lib/fast_excel/binding/chart.rb +20 -1
  20. data/lib/fast_excel/binding/workbook.rb +10 -2
  21. data/lib/fast_excel/binding/worksheet.rb +44 -27
  22. data/libxlsxwriter/.gitignore +1 -0
  23. data/libxlsxwriter/.indent.pro +5 -0
  24. data/libxlsxwriter/CMakeLists.txt +1 -11
  25. data/libxlsxwriter/CONTRIBUTING.md +1 -1
  26. data/libxlsxwriter/Changes.txt +84 -0
  27. data/libxlsxwriter/LICENSE.txt +1 -1
  28. data/libxlsxwriter/Makefile +7 -5
  29. data/libxlsxwriter/Readme.md +1 -1
  30. data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +1 -0
  31. data/libxlsxwriter/include/xlsxwriter.h +2 -2
  32. data/libxlsxwriter/include/xlsxwriter/app.h +2 -2
  33. data/libxlsxwriter/include/xlsxwriter/chart.h +56 -6
  34. data/libxlsxwriter/include/xlsxwriter/chartsheet.h +544 -0
  35. data/libxlsxwriter/include/xlsxwriter/common.h +27 -6
  36. data/libxlsxwriter/include/xlsxwriter/content_types.h +5 -2
  37. data/libxlsxwriter/include/xlsxwriter/core.h +2 -2
  38. data/libxlsxwriter/include/xlsxwriter/custom.h +2 -2
  39. data/libxlsxwriter/include/xlsxwriter/drawing.h +3 -2
  40. data/libxlsxwriter/include/xlsxwriter/format.h +3 -3
  41. data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
  42. data/libxlsxwriter/include/xlsxwriter/packager.h +13 -8
  43. data/libxlsxwriter/include/xlsxwriter/relationships.h +2 -2
  44. data/libxlsxwriter/include/xlsxwriter/shared_strings.h +5 -3
  45. data/libxlsxwriter/include/xlsxwriter/styles.h +9 -4
  46. data/libxlsxwriter/include/xlsxwriter/theme.h +2 -2
  47. data/libxlsxwriter/include/xlsxwriter/utility.h +26 -2
  48. data/libxlsxwriter/include/xlsxwriter/workbook.h +232 -55
  49. data/libxlsxwriter/include/xlsxwriter/worksheet.h +264 -53
  50. data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +3 -1
  51. data/libxlsxwriter/libxlsxwriter.podspec +1 -1
  52. data/libxlsxwriter/src/Makefile +3 -3
  53. data/libxlsxwriter/src/app.c +2 -2
  54. data/libxlsxwriter/src/chart.c +41 -5
  55. data/libxlsxwriter/src/chartsheet.c +508 -0
  56. data/libxlsxwriter/src/content_types.c +12 -4
  57. data/libxlsxwriter/src/core.c +2 -2
  58. data/libxlsxwriter/src/custom.c +2 -2
  59. data/libxlsxwriter/src/drawing.c +114 -17
  60. data/libxlsxwriter/src/format.c +3 -3
  61. data/libxlsxwriter/src/hash_table.c +1 -1
  62. data/libxlsxwriter/src/packager.c +369 -65
  63. data/libxlsxwriter/src/relationships.c +2 -2
  64. data/libxlsxwriter/src/shared_strings.c +18 -4
  65. data/libxlsxwriter/src/styles.c +56 -9
  66. data/libxlsxwriter/src/theme.c +2 -2
  67. data/libxlsxwriter/src/utility.c +53 -6
  68. data/libxlsxwriter/src/workbook.c +372 -56
  69. data/libxlsxwriter/src/worksheet.c +425 -76
  70. data/libxlsxwriter/src/xmlwriter.c +17 -8
  71. data/libxlsxwriter/third_party/minizip/ioapi.c +10 -0
  72. data/libxlsxwriter/third_party/minizip/zip.c +2 -0
  73. data/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c +2 -2
  74. data/libxlsxwriter/version.txt +1 -1
  75. data/test/tmpfile_test.rb +1 -0
  76. data/test/validations_test.rb +26 -6
  77. data/test/worksheet_test.rb +43 -0
  78. metadata +9 -6
  79. data/libxlsxwriter/.drone.yml +0 -27
  80. data/libxlsxwriter/appveyor.yml +0 -65
  81. data/libxlsxwriter/cmake/FindZLIB.cmake +0 -123
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Used in conjunction with the libxlsxwriter library.
5
5
  *
6
- * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
6
+ * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
7
7
  *
8
8
  */
9
9
 
@@ -140,6 +140,15 @@ lxw_xml_data_element(FILE * xmlfile,
140
140
  fprintf(xmlfile, "</%s>", tag);
141
141
  }
142
142
 
143
+ /*
144
+ * Write an XML <si> element for rich strings, without encoding.
145
+ */
146
+ void
147
+ lxw_xml_rich_si_element(FILE * xmlfile, const char *string)
148
+ {
149
+ fprintf(xmlfile, "<si>%s</si>", string);
150
+ }
151
+
143
152
  /*
144
153
  * Escape XML characters in attributes.
145
154
  */
@@ -153,19 +162,19 @@ _escape_attributes(struct xml_attribute *attribute)
153
162
  while (*p_attr) {
154
163
  switch (*p_attr) {
155
164
  case '&':
156
- strncat(p_encoded, LXW_AMP, sizeof(LXW_AMP) - 1);
165
+ memcpy(p_encoded, LXW_AMP, sizeof(LXW_AMP) - 1);
157
166
  p_encoded += sizeof(LXW_AMP) - 1;
158
167
  break;
159
168
  case '<':
160
- strncat(p_encoded, LXW_LT, sizeof(LXW_LT) - 1);
169
+ memcpy(p_encoded, LXW_LT, sizeof(LXW_LT) - 1);
161
170
  p_encoded += sizeof(LXW_LT) - 1;
162
171
  break;
163
172
  case '>':
164
- strncat(p_encoded, LXW_GT, sizeof(LXW_GT) - 1);
173
+ memcpy(p_encoded, LXW_GT, sizeof(LXW_GT) - 1);
165
174
  p_encoded += sizeof(LXW_GT) - 1;
166
175
  break;
167
176
  case '"':
168
- strncat(p_encoded, LXW_QUOT, sizeof(LXW_QUOT) - 1);
177
+ memcpy(p_encoded, LXW_QUOT, sizeof(LXW_QUOT) - 1);
169
178
  p_encoded += sizeof(LXW_QUOT) - 1;
170
179
  break;
171
180
  default:
@@ -195,15 +204,15 @@ lxw_escape_data(const char *data)
195
204
  while (*data) {
196
205
  switch (*data) {
197
206
  case '&':
198
- strncat(p_encoded, LXW_AMP, sizeof(LXW_AMP) - 1);
207
+ memcpy(p_encoded, LXW_AMP, sizeof(LXW_AMP) - 1);
199
208
  p_encoded += sizeof(LXW_AMP) - 1;
200
209
  break;
201
210
  case '<':
202
- strncat(p_encoded, LXW_LT, sizeof(LXW_LT) - 1);
211
+ memcpy(p_encoded, LXW_LT, sizeof(LXW_LT) - 1);
203
212
  p_encoded += sizeof(LXW_LT) - 1;
204
213
  break;
205
214
  case '>':
206
- strncat(p_encoded, LXW_GT, sizeof(LXW_GT) - 1);
215
+ memcpy(p_encoded, LXW_GT, sizeof(LXW_GT) - 1);
207
216
  p_encoded += sizeof(LXW_GT) - 1;
208
217
  break;
209
218
  default:
@@ -96,6 +96,7 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in
96
96
  {
97
97
  FILE* file = NULL;
98
98
  const char* mode_fopen = NULL;
99
+ (void) opaque;
99
100
  if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
100
101
  mode_fopen = "rb";
101
102
  else
@@ -114,6 +115,7 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,
114
115
  {
115
116
  FILE* file = NULL;
116
117
  const char* mode_fopen = NULL;
118
+ (void) opaque;
117
119
  if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
118
120
  mode_fopen = "rb";
119
121
  else
@@ -132,6 +134,7 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename,
132
134
  static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
133
135
  {
134
136
  uLong ret;
137
+ (void) opaque;
135
138
  ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
136
139
  return ret;
137
140
  }
@@ -139,6 +142,7 @@ static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf,
139
142
  static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
140
143
  {
141
144
  uLong ret;
145
+ (void) opaque;
142
146
  ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
143
147
  return ret;
144
148
  }
@@ -146,6 +150,7 @@ static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const voi
146
150
  static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
147
151
  {
148
152
  long ret;
153
+ (void) opaque;
149
154
  ret = ftell((FILE *)stream);
150
155
  return ret;
151
156
  }
@@ -154,6 +159,7 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
154
159
  static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
155
160
  {
156
161
  ZPOS64_T ret;
162
+ (void) opaque;
157
163
  ret = FTELLO_FUNC((FILE *)stream);
158
164
  return ret;
159
165
  }
@@ -162,6 +168,7 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs
162
168
  {
163
169
  int fseek_origin=0;
164
170
  long ret;
171
+ (void) opaque;
165
172
  switch (origin)
166
173
  {
167
174
  case ZLIB_FILEFUNC_SEEK_CUR :
@@ -185,6 +192,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
185
192
  {
186
193
  int fseek_origin=0;
187
194
  long ret;
195
+ (void) opaque;
188
196
  switch (origin)
189
197
  {
190
198
  case ZLIB_FILEFUNC_SEEK_CUR :
@@ -210,6 +218,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
210
218
  static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
211
219
  {
212
220
  int ret;
221
+ (void) opaque;
213
222
  ret = fclose((FILE *)stream);
214
223
  return ret;
215
224
  }
@@ -217,6 +226,7 @@ static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
217
226
  static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
218
227
  {
219
228
  int ret;
229
+ (void) opaque;
220
230
  ret = ferror((FILE *)stream);
221
231
  return ret;
222
232
  }
@@ -519,12 +519,14 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
519
519
  break;
520
520
 
521
521
  for (i=(int)uReadSize-3; (i--)>0;)
522
+ {
522
523
  if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
523
524
  ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
524
525
  {
525
526
  uPosFound = uReadPos+i;
526
527
  break;
527
528
  }
529
+ }
528
530
 
529
531
  if (uPosFound!=0)
530
532
  break;
@@ -169,7 +169,7 @@ static char *getenv_save(const char *varname, char *buf, size_t bufsize)
169
169
  buf[0] = '\0';
170
170
  if (ptr)
171
171
  {
172
- strncpy(buf, ptr, bufsize);
172
+ strncpy(buf, ptr, bufsize-1);
173
173
  buf[bufsize-1] = '\0';
174
174
  return buf;
175
175
  }
@@ -189,7 +189,7 @@ static FILE *mktempfile_internal(const char *tmpdir, const char *pfx, char **tmp
189
189
  */
190
190
  {
191
191
  FILE *fp;
192
- int fd;
192
+ int fd = 0;
193
193
  char randpart[] = "1234567890";
194
194
  size_t lentempname;
195
195
  int i;
@@ -1 +1 @@
1
- 2018-06-22 01:06:44 +0800 54dc4d0
1
+ 2019-06-17 01:19:43 +0800 56b73bb
@@ -17,6 +17,7 @@ describe "FastExcel" do
17
17
  workbook.read_string
18
18
 
19
19
  refute(File.exist?(workbook.filename))
20
+ refute(File.exist?(File.dirname(workbook.filename)))
20
21
  refute(workbook.is_open)
21
22
  end
22
23
 
@@ -14,14 +14,34 @@ describe "FastExcel validations" do
14
14
  assert_equal("Worksheet name 'Payments Report' is already in use", error.message)
15
15
  end
16
16
 
17
- it "should not raise error when worksheet name is empty string" do
17
+ it "should not raise error when worksheet name is null" do
18
18
  workbook = FastExcel.open(constant_memory: true)
19
19
 
20
- ws1 = workbook.add_worksheet("")
21
- ws2 = workbook.add_worksheet("")
20
+ ws1 = workbook.add_worksheet()
21
+ ws2 = workbook.add_worksheet()
22
22
  ws2.write_value(0, 2, "aaa")
23
23
 
24
- assert_equal("", ws1[:name])
25
- assert_equal("", ws2[:name])
24
+ assert_equal("Sheet1", ws1[:name])
25
+ assert_equal("Sheet2", ws2[:name])
26
26
  end
27
- end
27
+
28
+ it "should raise error when the sheet name exceeds maximum length" do
29
+ workbook = FastExcel.open(constant_memory: true)
30
+
31
+ error = assert_raises do
32
+ workbook.add_worksheet("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345")
33
+ end
34
+
35
+ assert_equal(ArgumentError, error.class)
36
+ assert_equal("Worksheet name 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345' exceeds Excel's limit of 31 characters", error.message)
37
+ end
38
+
39
+ it "should not raise error when the sheet name is at maximum length" do
40
+ workbook = FastExcel.open(constant_memory: true)
41
+
42
+ worksheet = workbook.add_worksheet("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234")
43
+ worksheet.append_row(["aaa", "bbb", "ccc"])
44
+
45
+ assert_equal("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234", worksheet[:name])
46
+ end
47
+ end
@@ -83,4 +83,47 @@ describe "FastExcel::WorksheetExt append_row" do
83
83
 
84
84
  assert_equal([[0.1234]], get_arrays(@workbook))
85
85
  end
86
+
87
+ it "should set name correctly" do
88
+ workbook = FastExcel.open(constant_memory: true)
89
+ ws1 = workbook.add_worksheet("foo")
90
+ ws2 = workbook.add_worksheet("")
91
+
92
+ assert_equal("foo", ws1[:name])
93
+ assert_equal("", ws2[:name])
94
+ end
95
+
96
+ it "should map fields correctly" do
97
+ workbook = FastExcel.open(constant_memory: true)
98
+
99
+ ws = workbook.add_worksheet
100
+ ws.set_right_to_left
101
+ assert_equal(ws[:right_to_left], 1)
102
+
103
+ ws = workbook.add_worksheet
104
+ ws.center_vertically
105
+ assert_equal(ws[:print_options_changed], 1)
106
+ assert_equal(ws[:vcenter], 1)
107
+
108
+ ws = workbook.add_worksheet
109
+ ws.print_row_col_headers
110
+ assert_equal(ws[:print_headers], 1)
111
+ assert_equal(ws[:print_options_changed], 1)
112
+
113
+ ws = workbook.add_worksheet
114
+ ws.set_margins(1.5, 2.5, 3.5, 4.5)
115
+ assert_equal(ws[:margin_left], 1.5)
116
+ assert_equal(ws[:margin_right], 2.5)
117
+ assert_equal(ws[:margin_top], 3.5)
118
+ assert_equal(ws[:margin_bottom], 4.5)
119
+
120
+
121
+ breaks = [20, 40, 60, 20, 0]
122
+ FFI::MemoryPointer.new(:uint16, breaks.size) do |buffer|
123
+ buffer.write_array_of_uint16(breaks)
124
+ ws.set_v_pagebreaks(buffer)
125
+ end
126
+
127
+ assert_equal(ws[:vbreaks_count], 4)
128
+ end
86
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_excel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Evstigneev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-26 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -38,9 +38,11 @@ extensions:
38
38
  - extconf.rb
39
39
  extra_rdoc_files: []
40
40
  files:
41
+ - ".dockerignore"
41
42
  - ".gitignore"
42
43
  - ".travis.yml"
43
44
  - CHANGELOG.md
45
+ - Dockerfile.test
44
46
  - Gemfile
45
47
  - Gemfile.lock
46
48
  - LICENSE
@@ -60,7 +62,9 @@ files:
60
62
  - examples/example_auto_width.rb
61
63
  - examples/example_chart.rb
62
64
  - examples/example_colors.rb
65
+ - examples/example_filters.rb
63
66
  - examples/example_formula.rb
67
+ - examples/example_hyperlink.rb
64
68
  - examples/example_image.rb
65
69
  - examples/example_styles.rb
66
70
  - examples/logo.png
@@ -75,7 +79,6 @@ files:
75
79
  - lib/fast_excel/binding/format.rb
76
80
  - lib/fast_excel/binding/workbook.rb
77
81
  - lib/fast_excel/binding/worksheet.rb
78
- - libxlsxwriter/.drone.yml
79
82
  - libxlsxwriter/.gitignore
80
83
  - libxlsxwriter/.indent.pro
81
84
  - libxlsxwriter/.travis.yml
@@ -85,16 +88,15 @@ files:
85
88
  - libxlsxwriter/LICENSE.txt
86
89
  - libxlsxwriter/Makefile
87
90
  - libxlsxwriter/Readme.md
88
- - libxlsxwriter/appveyor.yml
89
91
  - libxlsxwriter/cmake/FindMINIZIP.cmake
90
92
  - libxlsxwriter/cmake/FindPackage.cmake
91
- - libxlsxwriter/cmake/FindZLIB.cmake
92
93
  - libxlsxwriter/cmake/i686-toolchain.cmake
93
94
  - libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h
94
95
  - libxlsxwriter/cocoapods/libxlsxwriter.modulemap
95
96
  - libxlsxwriter/include/xlsxwriter.h
96
97
  - libxlsxwriter/include/xlsxwriter/app.h
97
98
  - libxlsxwriter/include/xlsxwriter/chart.h
99
+ - libxlsxwriter/include/xlsxwriter/chartsheet.h
98
100
  - libxlsxwriter/include/xlsxwriter/common.h
99
101
  - libxlsxwriter/include/xlsxwriter/content_types.h
100
102
  - libxlsxwriter/include/xlsxwriter/core.h
@@ -121,6 +123,7 @@ files:
121
123
  - libxlsxwriter/src/Makefile
122
124
  - libxlsxwriter/src/app.c
123
125
  - libxlsxwriter/src/chart.c
126
+ - libxlsxwriter/src/chartsheet.c
124
127
  - libxlsxwriter/src/content_types.c
125
128
  - libxlsxwriter/src/core.c
126
129
  - libxlsxwriter/src/custom.c
@@ -193,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
196
  - !ruby/object:Gem::Version
194
197
  version: '0'
195
198
  requirements: []
196
- rubygems_version: 3.0.1
199
+ rubygems_version: 3.0.6
197
200
  signing_key:
198
201
  specification_version: 4
199
202
  summary: Ultra Fast Excel Writer
@@ -1,27 +0,0 @@
1
- build:
2
- image: teaci/msys$$arch
3
- pull: true
4
- shell: msys$$arch
5
- commands:
6
- - if [ $$arch = 32 ]; then target=i686; fi
7
- - if [ $$arch = 64 ]; then target=x86_64; fi
8
- - pacman -S --needed --noconfirm --noprogressbar mingw-w64-${target}-pkg-config cmake zlib-devel
9
- - git submodule update --init --recursive
10
- - cmake -DBUILD_STATIC=$STATIC -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTS=ON -DIOAPI_NO_64=ON .
11
- - make -j 8
12
- - make install
13
- - ctest -C $BUILD_TYPE -V
14
-
15
- matrix:
16
- arch:
17
- # Bug with 64-bit MSYS2 on WINE currently, disable temporarily.
18
- # - 64
19
- - 32
20
-
21
- STATIC:
22
- - OFF
23
- - ON
24
-
25
- BUILD_TYPE:
26
- - Debug
27
- - Release
@@ -1,65 +0,0 @@
1
- version: '{build}'
2
-
3
- clone_depth: 1
4
-
5
- platform:
6
- - x64
7
- - x86
8
-
9
- os:
10
- - Visual Studio 2015
11
- - Visual Studio 2017
12
-
13
- environment:
14
- matrix:
15
- - additional_flags: ""
16
- STATIC: ON
17
- ZLIB_LIB: zlibstatic
18
-
19
- - additional_flags: "/std:c++latest"
20
- STATIC: ON
21
- ZLIB_LIB: zlibstatic
22
-
23
- - additional_flags: ""
24
- STATIC: OFF
25
- ZLIB_LIB: zlib
26
-
27
- - additional_flags: "/std:c++latest"
28
- STATIC: OFF
29
- ZLIB_LIB: zlib
30
-
31
- matrix:
32
- fast_finish: true
33
- exclude:
34
- - additional_flags: "/std:c++latest"
35
- os: Visual Studio 2015
36
-
37
- configuration:
38
- #- Debug
39
- - Release
40
-
41
- init: []
42
-
43
- install: []
44
-
45
- build_script:
46
- # Set the correct generator
47
- - IF "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" ( SET GEN="Visual Studio 14 2015") ELSE (SET GEN="Visual Studio 15 2017")
48
- # ZLIB isn't included on Windows, and no package manager has a static,
49
- # /MT-linked build, so we can download it and build it ourselves
50
- - appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
51
- - 7z x zlib-1.2.11.tar.gz > NUL
52
- - 7z x zlib-1.2.11.tar > NUL
53
- - cd zlib-1.2.11
54
- - cmake -G %GEN% -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_C_FLAGS_RELEASE="/MT"
55
- - cmake --build . --config %configuration%
56
- # Configure libxlsxwriter to use the static ZLIB
57
- - cd ..
58
- - cmake . -G%GEN% -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_C_FLAGS_RELEASE="/MT" -DBUILD_STATIC=%STATIC% -DBUILD_TESTS=ON -DZLIB_LIBRARY=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\Release\%ZLIB_LIB%.lib -DZLIB_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11
59
- - cmake --build . --config %configuration% --target install
60
-
61
- test_script:
62
- # Currently disable tests for MSVC: There's an issue with the test runner, not the library.
63
- # All the examples work properly.
64
- # - IF "%STATIC%" == OFF ( copy %APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\Release\%ZLIB_LIB%.dll %APPVEYOR_BUILD_FOLDER%\%configuration%\%ZLIB_LIB%.dll )
65
- - IF %STATIC% == ON ( ctest -C %configuration% -V )