-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
110 lines (98 loc) · 3 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 'java'
id "com.github.node-gradle.node" version '3.3.0'
id 'com.enonic.xp.app' version '3.1.0'
id 'no.item.xp.codegen' version '2.0.1'
id 'maven-publish'
}
app {
name = "${appName}"
displayName = "${appDisplayName}"
vendorName = "${vendorName}"
vendorUrl = "${vendorUrl}"
systemVersion = "${xpVersion}"
}
dependencies {
implementation "com.enonic.xp:script-api:${xpVersion}"
include "com.enonic.xp:lib-event:${xpVersion}"
include "com.enonic.xp:lib-content:${xpVersion}"
include "com.enonic.xp:lib-portal:${xpVersion}"
include "com.enonic.lib:lib-static:1.0.2"
include "com.enonic.lib:lib-guillotine:6.0.5"
include 'com.enonic.lib:lib-nextjs:0.10.0'
include "com.enonic.xp:lib-context:${xpVersion}"
include 'com.enonic.lib:lib-menu:4.1.1'
include "com.enonic.lib:lib-graphql-playground:0.0.1"
include "com.enonic.xp:lib-websocket:${xpVersion}"
include "com.enonic.lib:lib-util:3.0.0"
}
repositories {
mavenLocal()
mavenCentral()
xp.enonicRepo()
}
node {
download = true
version = '16.0.0'
}
task npmInstallForce( type: NpmTask ) {
description = 'Update all project node dependencies'
args = ['install', '--force']
}
task cleanNode( type: org.gradle.api.tasks.Delete ) {
delete 'node_modules'
}
task serverWebpack( type: NodeTask, dependsOn: [ npmInstall, generateTypeScript ] ) {
environment = [ 'NODE_ENV': nodeEnvironment() ]
// args = [ '--config', 'webpack.server.config.babel.js', '--color', '--hide-modules' ]
args = [ '--config', 'webpack.server.config.js', '--color' ]
description = 'Build server JS.'
inputs.dir 'src/main'
outputs.dir "${buildDir}/resources/main"
script = file( 'node_modules/webpack-cli/bin/cli.js' )
}
processResources {
include '**/*'
exclude '**/.gitkeep'
exclude '**/tsconfig.*.json'
exclude '**/*.es'
exclude '**/*.es6'
exclude '**/*.ts'
exclude 'assets/js/**/*.js'
include 'assets/js/bundle.js'
exclude 'assets/styles/**/*.less'
exclude 'assets/styles/**/*.sass'
exclude 'assets/styles/**/*.scss'
includeEmptyDirs false
}
jar {
exclude 'assets/styles/**/*.less'
exclude 'assets/styles/**/*.sass'
exclude 'assets/styles/**/*.scss'
exclude 'assets/styles/**/*.js'
dependsOn += generateTypeScript
dependsOn += serverWebpack
}
jar.outputs.dir "${buildDir}/resources/main"
def nodeEnvironment() {
def environments = [ prod : 'production', dev: 'development' ]
def nodeEnv = environments[hasProperty( 'env' ) ? env : 'prod']
return nodeEnv != null ? nodeEnv : 'production'
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/lienas/cms-lyn")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}