-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
101 lines (78 loc) · 2.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
sinclude .env # create from example.env
PROJECT ?= nf-quilt
WRITE_BUCKET ?= quilt-example
FRAGMENT ?= &path=.
NF_DIR ?= ../nextflow
PID ?= $$$$
PIPELINE ?= sarek
QUERY ?= ?Name=$(USER)&Owner=Kevin+Moore&Date=2023-03-07&Type=CRISPR&Notebook+URL=http%3A%2F%2Fexample.com
TEST_URI ?= quilt+s3://$(WRITE_BUCKET)$(QUERY)\#package=test/hurdat$(FRAGMENT)
QUILT_URI ?= quilt+s3://$(WRITE_BUCKET)\#package=$(PROJECT)/$(PIPELINE)
REPORT ?= ./plugins/$(PROJECT)/build/reports/tests/test/index.html
VERSION ?= $(shell grep 'Plugin-Version' plugins/$(PROJECT)/src/resources/META-INF/MANIFEST.MF | awk '{ print $$2 }')
verify: #compile
echo $(WRITE_BUCKET)
./gradlew check || open $(REPORT)
fast:
./gradlew ${mm}test --fail-fast || open ./plugins/nf-quilt/build/reports/tests/test/index.html
check-env:
echo $(VERSION)
echo $(WRITE_BUCKET)
echo "$(TEST_URI)"
echo "Use 'make WRITE_BUCKET=<value>' to override"
printenv MAKEFLAGS
clean:
./gradlew clean
rm -rf null results
rm -rf */*/build plugins/nf-quilt/bin
rm -f .nextflow.log* .launch*classpath
compile:
./gradlew compileGroovy exportClasspath
@echo "DONE `date`"
nextflow:
if [ ! -d "$(NF_DIR)" ]; then git clone https://github.com/nextflow-io/nextflow.git "$(NF_DIR)"; fi
cd "$(NF_DIR)"; git checkout && make compile && git restore .; cd ..
compile-all: nextflow compile
check:
./gradlew check --warning-mode all
.PHONY: clean test test-all all pkg-test tower-test
test: clean compile check #coverage
test-nextflow: clean nextflow compile check #coverage
test-all: clean compile-all check #coverage
#
# Create packages
#
pkg-test: compile-all
echo "$(TEST_URI)"
./launch.sh run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"
pkg-fail: compile
echo "$(TEST_URI)"
./launch.sh run ./fail.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)"
tower-test: compile-all
nextflow run "https://github.com/quiltdata/nf-quilt" -name local_einstein -with-tower -r main -latest --pub "$(TEST_URI)"
# use `make $(PIPELINE) WRITE_BUCKET=my-s3-bucket` to publish `--outdir` to a Quilt package
$(PIPELINE): compile install
echo "Ensure you have docker running"
nextflow pull nf-core/$(PIPELINE)
nextflow run nf-core/$(PIPELINE) -profile test,docker -plugins $(PROJECT)@$(VERSION) --outdir "$(QUILT_URI)"
#
# Show dependencies
#
deps:
./gradlew -q ${mm}dependencies
#
# Refresh SNAPSHOTs dependencies
#
refresh:
./gradlew --refresh-dependencies dependencies
install: compile
./gradlew copyPluginZip
rm -rf ${HOME}/.nextflow/plugins/$(PROJECT)-${VERSION}
cp -r build/plugins/$(PROJECT)-${VERSION} ${HOME}/.nextflow/plugins/
#
# Upload JAR artifacts to Maven Central
publish:
echo "Ensure you have set 'github_organization=<owner>' in gradle.properties"
ls gradle.properties # create locally or globally if it does not exist
./gradlew :plugins:$(PROJECT):upload
./gradlew :plugins:publishIndex