Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

933 B
Raw Blame
plugins {
  id 'base'
}

tasks.register('npmBuild', Exec) {
  mustRunAfter npmClean
  dependsOn getYarnInstallTask()
  dependsOn getRootProject().getSubprojects().collect {
    it.tasks.matching {
      it.name == 'npmAnalyze'
    }
  }
  commandLine npmCommand("yarn"), "run", "build"
}

tasks.register('npmTest', Exec) {
  dependsOn ":ui:test:installTestDeps", ":ui:test:clean"
  commandLine npmCommand("yarn"), "run", "test"
  args((findProperty('args')?.toString()?.tokenize()) ?: [])
}

tasks.register('cleanDist') {
  dependsOn npmClean
}

tasks.register('prepareUi') {
  dependsOn clean, npmPrepare
}

tasks.register('publishUi') {
  dependsOn clean, npmPublish
}

tasks.register('installDist', Copy) {
  dependsOn(npmBuild)
  mustRunAfter ":manager:installDist"
  from layout.buildDirectory.dir("dist")
  into project(':manager').layout.buildDirectory.dir("install/manager/web/${project.name}")
}

clean.dependsOn(cleanDist)