-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
156 lines (130 loc) · 4.29 KB
/
build.gradle
File metadata and controls
156 lines (130 loc) · 4.29 KB
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
148
149
150
151
152
153
154
155
156
plugins {
id 'java'
id 'maven-publish'
id 'com.enonic.defaults' version '2.1.6'
id 'com.enonic.xp.base' version '3.6.2'
id "com.github.node-gradle.node" version '7.1.0'
}
apply from: "$rootDir/gradle/env.gradle"
apply from: "$rootDir/gradle/node.gradle"
configurations {
devResources {
attributes {
attribute LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named( LibraryElements, 'dev-resources' )
}
}
}
repositories {
mavenCentral()
xp.enonicRepo()
}
group = 'com.enonic.lib'
base {
archivesName = 'lib-admin-ui'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of( 25 )
}
}
publishing {
publications {
mavenJava( MavenPublication ) {
pom {
name = 'Enonic Admin UI Library'
description = 'UI components for Enonic XP applications'
url = 'https://github.com/enonic/lib-admin-ui'
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://github.com/enonic/lib-admin-ui/blob/master/LICENSE.txt'
}
}
developers {
developer {
id = 'developers'
name = 'Enonic developers'
email = 'developers@enonic.com'
}
}
scm {
connection = 'scm:git:https://github.com/enonic/lib-admin-ui.git'
developerConnection = 'scm:git:git@github.com:enonic/lib-admin-ui.git'
url = 'https://github.com/enonic/lib-admin-ui'
}
}
}
}
}
tasks.register( 'pnpmCheck', PnpmTask ) {
dependsOn tasks.named( 'pnpmInstall' )
args = ['run', 'check']
outputs.upToDateWhen { false }
}
tasks.named( 'check' ).configure {
dependsOn tasks.named( 'pnpmCheck' )
}
tasks.register( 'pnpmBuild', PnpmTask ) {
dependsOn tasks.named( 'pnpmInstall' )
description = 'Build JavaScript for .xp, and Lib script and styles'
args = ['run', "build:${environmentShort()}"]
inputs.dir 'src/main/resources/assets/admin/common'
inputs.files 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.legacy.json', 'tsconfig.modern.json',
'vite.config.ts', 'package.json'
outputs.dirs layout.buildDirectory.dir('resources/main/dev/lib-admin-ui'),
layout.buildDirectory.dir('resources/main/assets/admin/common')
}
tasks.register( 'copyPackage', Copy ) {
dependsOn tasks.named( 'pnpmBuild' )
from 'package.json'
into layout.buildDirectory.dir('resources/main/dev/lib-admin-ui')
}
tasks.named( 'processResources' ).configure {
// Handled by the Vite
exclude 'assets/admin/common/fonts/**'
// Images are inlined to the CSS
exclude 'assets/admin/common/images/**'
// Bundled into lib.js
exclude 'assets/admin/common/lib/**'
}
tasks.named( 'jar' ).configure {
exclude 'dev/**'
exclude 'assets/**/*.ts', 'assets/**/*.tsx'
includeEmptyDirs = false
dependsOn tasks.named( 'copyPackage' )
}
tasks.register( 'devJar', Jar ) {
archiveClassifier = 'dev-resources'
from sourceSets.main.output
include 'dev/**'
exclude 'dev/lib-admin-ui/lib.js', 'dev/lib-admin-ui/lib.d.ts', 'dev/lib-admin-ui/*.tsbuildinfo'
into( "dev/${base.archivesName.get()}/fonts" ) {
from layout.buildDirectory.dir( 'resources/main/assets/admin/common/fonts' )
include '**/*.*'
}
into( "dev/${base.archivesName.get()}/styles" ) {
from layout.buildDirectory.dir( 'resources/main/assets/admin/common/styles' )
include '**/*.less'
}
includeEmptyDirs = false
dependsOn tasks.named( 'copyPackage' )
}
tasks.named( 'assemble' ) {
dependsOn tasks.named( 'devJar' )
}
artifacts {
devResources devJar
}
components.java.addVariantsFromConfiguration( configurations.devResources ) {
}
tasks.register( 'yolo' ) {
description = 'Build without running install, check, or test tasks'
dependsOn tasks.named( 'build' )
nodeSetup.enabled = false
npmSetup.enabled = false
pnpmSetup.enabled = false
pnpmInstall.enabled = false
pnpmCheck.enabled = false
check.enabled = false
test.enabled = false
}