forked from freeplane/freeplane
-
Notifications
You must be signed in to change notification settings - Fork 1
/
src.dist.gradle
147 lines (124 loc) · 4.61 KB
/
src.dist.gradle
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import org.apache.tools.ant.filters.FixCrLfFilter
// some shorthands for often-used include(...)/exclude(...) specs:
def textFilesIncludeSpec(dir) {
if (dir == null)
return ['**/*.java',
'**/*.xml',
'**/*.xsl',
'**/*.mm',
'**/*.properties',
'**/*.gradle']
else
return [dir + '/**/*.java',
dir + '/**/*.xml',
dir + '/**/*.xsl',
dir + '/**/*.mm',
dir + '/**/*.properties',
dir + '/**/*.gradle']
}
def buildFiles() {
return ['*/build/**', '**/bin/**', '*/apt_generated/**', '*/out/**']
}
def miscExcludedFilesSpec() {
return [
/* dot files */ '**/.*/**',
/* might include credentials! */ '**/signjar*.properties'
]
}
// NOTE: if you change excludes here, also adapt task 'srcpureTarGz' below
// (unfortunately there is some redundancy)!
task srcTarGz(type: Tar) {
destinationDirectory = new File(globalDist)
archiveFileName = 'freeplane_src-' + distVersion + '.tar.gz'
compression = 'GZIP'
includeEmptyDirs = false
// text files (convert to LF)
from(rootDir) {
include('license.txt')
include('*.gradle')
include(textFilesIncludeSpec('freeplane*'))
include(textFilesIncludeSpec('JOrtho_0.4_freeplane'))
// exclude gradle/eclipse build files for all projects:
exclude(buildFiles())
// exclude misc files:
exclude(miscExcludedFilesSpec())
filter(FixCrLfFilter.class,
eol:FixCrLfFilter.CrLf.newInstance("lf"), fixlast:false)
}
// all other (source) files
from(rootDir) {
include('freeplane*/**')
include('JOrtho_0.4_freeplane/**')
exclude(textFilesIncludeSpec(null))
// exclude gradle/eclipse build files for all projects:
exclude(buildFiles())
// exclude misc files:
exclude(miscExcludedFilesSpec())
}
// these two files must be included because they are generated from git info
// and git info is not available int src/srcpure distribs!
from(globalBin) {
include('gitinfo.txt')
}
from(globalBin + '/resources') {
include('gitinfo.properties')
}
into('freeplane-' + distVersion)
}
def srcpureAdditionalExcludeSpec() {
// built from latex.flex using jflex!
return ['freeplane_plugin_jsyntaxpane/src/main/java/jsyntaxpane/lexers/LaTeXLexer.java',
// the flash files don't have a source in the freeplane-distrib,
// which is a problem for Debian,
// see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=736106
// (the source is here: https://github.com/freeplane/misc/tree/master/flash-browser)
// => there is an (inactive) Debian package here:
// https://github.com/fnatter/freeplane-flash-browser-debian/
'freeplane/resources/flash/visorFreeplane.swf', 'freeplane/resources/flash/flashobject.js',
// windows stuff
'**/*.exe', '**/*.res', '**/*.jar', '**/*.dll',
// MAC stuff
'**/*JavaApplicationStub*']
}
task srcpureTarGz(type: Tar) {
destinationDirectory = new File(globalDist)
archiveFileName = 'freeplane_srcpure-' + distVersion + '.tar.gz'
compression = 'GZIP'
includeEmptyDirs = false
// text files (convert to LF)
from(rootDir) {
include('license.txt')
include('*.gradle')
include(textFilesIncludeSpec('freeplane*'))
include(textFilesIncludeSpec('JOrtho_0.4_freeplane'))
// exclude gradle/eclipse build files for all projects:
exclude(buildFiles())
// exclude misc files:
exclude(miscExcludedFilesSpec())
// exclude additional srcpure stuff
exclude(srcpureAdditionalExcludeSpec())
filter(FixCrLfFilter.class,
eol:FixCrLfFilter.CrLf.newInstance("lf"), fixlast:false)
}
// all other (source) files
from(rootDir) {
include('freeplane*/**')
include('JOrtho_0.4_freeplane/**')
exclude(textFilesIncludeSpec(null))
// exclude gradle/eclipse build files for all projects:
exclude(buildFiles())
// exclude misc files:
exclude(miscExcludedFilesSpec())
// exclude additional srcpure stuff
exclude(srcpureAdditionalExcludeSpec())
}
// these two files must be included because they are generated from git info
// and git info is not available int src/srcpure distribs!
from(globalBin) {
include('gitinfo.txt')
}
from(globalBin + '/resources') {
include('gitinfo.properties')
}
into('freeplane-' + distVersion)
}