@@ -86,6 +86,44 @@ task archiveReports(type: Zip) {
86
86
destinationDirectory = file(" $buildDir /libs" )
87
87
}
88
88
89
+ task archiveTranslations (type : Zip ) {
90
+ def fileName = " "
91
+ file(" modules" ). traverse(type : groovy.io.FileType . DIRECTORIES , maxDepth : 1 ) { dir ->
92
+ if (new File (dir, " build.gradle" ). exists() && (new File (dir, " /src/main/resources/i18n" ). exists())) {
93
+ def files = new File (dir, " /src/main/resources/i18n/" ). listFiles()
94
+ for (File file : files) {
95
+ if (project. hasProperty(" languageCode" ) && file. getName(). contains(project. getProperty(" languageCode" ))) {
96
+ from(file. getPath()){
97
+ fileName = dir. getName()+ " _" + file. getName()
98
+ def newFile = new File (dir, " /src/main/resources/i18n/" + fileName);
99
+ rename{newFile. name}
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ classifier ' i18n'
106
+ includeEmptyDirs = false
107
+ destinationDirectory = project. hasProperty(" destinationPath" ) ? file(project. getProperty(" destinationPath" )) : file(" $rootDir /translationsFiles" )
108
+ }
109
+
110
+ task copyTranslations (type : Copy ){
111
+ def filePath = " "
112
+ def fileName = " "
113
+ if (project. hasProperty(" translationsFolderPath" ) && project. hasProperty(" basePath" )) {
114
+ def sourceDirFiles = new File (project. getProperty(" translationsFolderPath" )). listFiles()
115
+ for (File sourceFile : sourceDirFiles) {
116
+ from(sourceFile. getPath()){
117
+ def a = sourceFile. getName(). split(" _" )
118
+ filePath = a[0 ] + " /src/main/resources/i18n/" ;
119
+ fileName = a[1 ]+ " _" + a[2 ]+ " "
120
+ rename{ fileName}
121
+ into (filePath)
122
+ }
123
+ }
124
+ into(" $rootDir /" + project. getProperty(" basePath" ))
125
+ }
126
+ }
89
127
90
128
task generateChangeLog (type : GenerateAosChangelog ) {
91
129
group " Axelor application"
0 commit comments