-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
110 lines (96 loc) · 2.84 KB
/
build.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
plugins {
id 'base'
id 'de.dfki.mary.voicebuilding.marytts-kaldi-mfa' version '0.4.1'
id 'org.m2ci.msp.flaml' version '0.4.0'
}
group 'de.dfki.mary'
version '0.3.0-SNAPSHOT'
description 'Upper Sorbian voice data for MaryTTS'
repositories {
exclusiveContent {
forRepository {
ivy {
url 'https://digital.serbski-institut.de/marytts'
patternLayout {
artifact '[module](_[revision]).[ext]'
}
metadataSources {
artifact()
}
}
}
filter {
includeGroup 'de.serbski-institut'
}
}
}
configurations {
data
}
dependencies {
data group: 'de.serbski-institut', name: 'hsb_audio_data', version: '20241010', ext: 'zip'
marytts group: 'de.dfki.mary', name: 'marytts-lang-hsb', version: '0.2.1'
}
def unpackDataTask = tasks.register('unpackData') {
ext.textDir = objects.directoryProperty()
.convention(layout.buildDirectory.dir('text'))
ext.wavDir = objects.directoryProperty()
.convention(layout.buildDirectory.dir('wav'))
outputs.dir textDir
outputs.dir wavDir
doLast {
copy {
into temporaryDir
from configurations.data
filesMatching '*.zip', { zipDetails ->
copy {
into textDir
from zipTree(zipDetails.file)
include '**/text/*.txt'
eachFile { it.path = it.name }
includeEmptyDirs = false
}
copy {
into wavDir
from zipTree(zipDetails.file)
include '**/wav/*.wav'
eachFile { it.path = it.name }
includeEmptyDirs = false
}
}
}
}
}
convertTextToMaryXml {
locale.set Locale.forLanguageTag('hsb')
srcDir.set unpackDataTask.get().textDir
}
prepareForcedAlignment {
wavDir.set unpackDataTask.get().wavDir
}
generateComments {
properties = [
Description: project.description,
Contact : 'https://github.com/marytts/serbski-institut-hsb-data',
License : 'https://creativecommons.org/licenses/by-nc-sa/4.0/'
]
}
generateFlac {
srcFiles = unpackDataTask.get().wavDir.asFileTree
}
generateYaml {
yamlFile.set file("${project.name}.yaml")
}
injectText {
yamlSrcFile.set generateYaml.yamlFile
textDir.set unpackDataTask.get().textDir
yamlDestFile.set file("${project.name}_text.yaml")
}
injectSegments {
yamlSrcFile.set injectText.yamlDestFile
labDir.set tasks.named('convertTextGridToXLab').get().destDir
}
artifacts {
'default' tasks.named('generateFlac').get().flacFile,
tasks.named('injectSegments').get().yamlDestFile
}