mirror of https://github.com/halo-dev/halo
Merge pull request #5314 from JohnNiang/refactor/console-as-subproject
Add Gradle build script for ui projectpull/5340/head
commit
2cf19a4581
|
@ -27,9 +27,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-env
|
||||
- name: Check Halo console
|
||||
run: make -C console check
|
||||
- name: Check Halo core
|
||||
- name: Check Halo
|
||||
run: ./gradlew check
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
@ -42,8 +40,6 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-env
|
||||
- name: Build Halo console
|
||||
run: make -C console build
|
||||
- name: Reset version of Halo
|
||||
if: github.event_name == 'release'
|
||||
shell: bash
|
||||
|
@ -52,7 +48,7 @@ jobs:
|
|||
version=${{ github.event.release.tag_name }}
|
||||
version=${version#v}
|
||||
sed -i "s/version=.*-SNAPSHOT$/version=$version/1" gradle.properties
|
||||
- name: Build Halo core
|
||||
- name: Build Halo
|
||||
run: ./gradlew clean && ./gradlew downloadPluginPresets && ./gradlew build -x check
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
@ -82,6 +82,14 @@ tasks.register('createChecksums', Checksum) {
|
|||
checksumAlgorithm = Checksum.Algorithm.SHA256
|
||||
}
|
||||
|
||||
tasks.named('processResources', ProcessResources) {
|
||||
from project(':ui').layout.buildDirectory.dir('dist')
|
||||
into layout.buildDirectory.dir('resources/main')
|
||||
configure {
|
||||
mustRunAfter project(':ui').tasks.named('build')
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named('build') {
|
||||
dependsOn tasks.named('createChecksums')
|
||||
}
|
||||
|
|
13
build.gradle
13
build.gradle
|
@ -1,13 +0,0 @@
|
|||
plugins {
|
||||
id "org.sonarqube" version "4.4.1.3373"
|
||||
}
|
||||
|
||||
group = "run.halo.app"
|
||||
|
||||
sonar {
|
||||
properties {
|
||||
property "sonar.projectKey", "halo-dev_halo"
|
||||
property "sonar.organization", "halo-dev"
|
||||
property "sonar.host.url", "https://sonarcloud.io"
|
||||
}
|
||||
}
|
|
@ -6,4 +6,4 @@ pluginManagement {
|
|||
}
|
||||
|
||||
rootProject.name = 'halo'
|
||||
include 'api', 'application', 'platform:application', 'platform:plugin'
|
||||
include 'api', 'application', 'platform:application', 'platform:plugin', 'ui'
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
plugins {
|
||||
id "com.github.node-gradle.node" version "7.0.1"
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete layout.buildDirectory
|
||||
delete fileTree('packages') {
|
||||
include '*/dist/**'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('build', PnpmTask) {
|
||||
dependsOn tasks.named('check'), tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'build']
|
||||
inputs.files(fileTree(layout.projectDirectory) {
|
||||
include 'console-src/**', 'uc-src/**', 'src/**', 'public/**', '*.js', '*.json', '*.yaml', 'index.html'
|
||||
exclude '**/node_modules/**', '**/build/**', '**/dist/**'
|
||||
})
|
||||
outputs.dir(layout.buildDirectory.dir('dist'))
|
||||
configure {
|
||||
shouldRunAfter tasks.named('clean')
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('buildPackages', PnpmTask) {
|
||||
dependsOn tasks.named('pnpmInstall')
|
||||
inputs.files(fileTree('packages') {
|
||||
exclude '**/node_modules/**', '**/dist/**'
|
||||
})
|
||||
inputs.file('package.json')
|
||||
pnpmCommand = ['run', 'build:packages']
|
||||
outputs.files(fileTree('packages') {
|
||||
include '*/dist/**'
|
||||
})
|
||||
}
|
||||
|
||||
tasks.register('test', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'test:unit']
|
||||
shouldRunAfter tasks.named('lint'), tasks.named('typecheck')
|
||||
}
|
||||
|
||||
tasks.register('lint', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'lint']
|
||||
}
|
||||
|
||||
tasks.register('typecheck', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'typecheck']
|
||||
}
|
||||
|
||||
tasks.register('check') {
|
||||
dependsOn tasks.named('lint'), tasks.named('typecheck'), tasks.named('test')
|
||||
}
|
||||
|
||||
tasks.register('dev', PnpmTask) {
|
||||
dependsOn tasks.named('buildPackages')
|
||||
pnpmCommand = ['run', 'dev']
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue