Skip to content

Commit 6b855e8

Browse files
committedNov 12, 2019
Try to make it build with docker
1 parent 20f1d96 commit 6b855e8

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed
 

‎.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
libxlsxwriter
2+
.git

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ gen_ffi.rb
88
a.out
99
.DS_Store
1010
*.gem
11+
*.cmake
12+
libxlsxwriter/CmakeFiles
13+
libxlsxwriter/CmakeCache.txt
1114
libxlsxwriter/dev
1215
libxlsxwriter/docs
1316
libxlsxwriter/examples

‎.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ matrix:
2121
rvm: 2.5.5
2222
- os: linux
2323
rvm: 2.6.3
24+
env: BUILD_DOCKER=true
2425
- os: osx
2526
rvm: 2.6.3
2627
osx_image: xcode10.2
@@ -38,3 +39,4 @@ script:
3839
- make
3940
- bundle exec rake test
4041
- bundle exec rake examples
42+
- [ -z "$BUILD_DOCKER" ] && docker build . -f Dockerfile.test --build-arg TRAVIS_COMMIT || true

‎Dockerfile.test

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ruby
2+
3+
RUN gem install fast_excel
4+
5+
ARG TRAVIS_COMMIT
6+
7+
RUN echo "source 'https://rubygems.org'" > Gemfile
8+
9+
RUN [ -z "$TRAVIS_COMMIT" ] && \
10+
echo "gem 'fast_excel', git: 'https://github.com/Paxa/fast_excel.git'" >> Gemfile || true
11+
RUN [ -z "$TRAVIS_COMMIT" ] || \
12+
echo "gem 'fast_excel', git: 'https://github.com/Paxa/fast_excel.git', ref: '$TRAVIS_COMMIT'" >> Gemfile
13+
14+
RUN cat Gemfile
15+
RUN bundle

‎Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ ifdef V
33
Q=
44
endif
55

6+
# with xcode better to use cmake
7+
UNAME_S := $(shell uname -s)
8+
ifeq ($(UNAME_S),"Darwin")
9+
USE_CMAKE := $(shell command -v cmake 2> /dev/null)
10+
endif
11+
612
all :
713
@echo "Compiling ext/text_width ..."
814
rake compile
915
@echo "Compiling libxlsxwriter ..."
16+
ifdef USE_CMAKE
17+
@echo "run cmake libxlsxwriter ..."
18+
cmake libxlsxwriter
19+
else
1020
$(Q)$(MAKE) -C libxlsxwriter
21+
endif
1122

1223
clean :
1324
$(Q)$(MAKE) clean -C libxlsxwriter

‎libxlsxwriter/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ examples :
3434
# Clean src and test directories.
3535
clean :
3636
$(Q)$(MAKE) clean -C src
37-
$(Q)$(MAKE) clean -C test/unit
38-
$(Q)$(MAKE) clean -C test/functional/src
37+
# $(Q)$(MAKE) clean -C test/unit
38+
# $(Q)$(MAKE) clean -C test/functional/src
3939
$(Q)$(MAKE) clean -C examples
4040
$(Q)rm -rf docs/html
4141
$(Q)rm -rf test/functional/__pycache__

0 commit comments

Comments
 (0)