Java watch and build tool

Build utility with build tools that can also watch the same tasks.

License

License

Categories

Categories

Java Languages
GroupId

GroupId

hr.hrg
ArtifactId

ArtifactId

java-watch-build
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Java watch and build tool
Build utility with build tools that can also watch the same tasks.
Project URL

Project URL

http://github.com/hrgdavor/java-watch-build
Source Code Management

Source Code Management

http://github.com/hrgdavor/java-watch-build/tree/master

Download java-watch-build

How to add to project

<!-- https://jarcasting.com/artifacts/hr.hrg/java-watch-build/ -->
<dependency>
    <groupId>hr.hrg</groupId>
    <artifactId>java-watch-build</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/hr.hrg/java-watch-build/
implementation 'hr.hrg:java-watch-build:0.2.0'
// https://jarcasting.com/artifacts/hr.hrg/java-watch-build/
implementation ("hr.hrg:java-watch-build:0.2.0")
'hr.hrg:java-watch-build:jar:0.2.0'
<dependency org="hr.hrg" name="java-watch-build" rev="0.2.0">
  <artifact name="java-watch-build" type="jar" />
</dependency>
@Grapes(
@Grab(group='hr.hrg', module='java-watch-build', version='0.2.0')
)
libraryDependencies += "hr.hrg" % "java-watch-build" % "0.2.0"
[hr.hrg/java-watch-build "0.2.0"]

Dependencies

compile (7)

Group / Artifact Type Version
hr.hrg : java-watch-sass jar 0.2.0
hr.hrg » java-watch-copy jar 0.2.0
hr.hrg : java-watcher jar 0.2.0
com.fasterxml.jackson.core : jackson-databind jar 2.7.0
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.7.0
com.google.javascript : closure-compiler jar v20161201
org.slf4j : slf4j-simple jar 1.7.21

Project Modules

There are no modules declared in this project.

Java watch build Maven Central

Introduction

The main goal for this project is to create a specific utility for building my own projects that can also be left running to watch for changes and rebuild as soon as possible.

In the sea of options for building your projects, sometimes it is difficult to find one that suits you just right. So, I wrote this one specifically for myself. Make sure to check tools with bigger communities before creating your own trying this one :) .

One of the first tools I wanted to have included was a SASS build/watch and after i found libsass-maven-plugin I started to create it. The libsass-maven-plugin is an excellent choice if you need to compile SASS as part of your maven build, and since recently also has watch option.

If you use gradle then you most likely just need to run it in continuous mode, check thiis blog post gradle continuous build for details or gradle docs

Latest release is 0.2.0 but you can build the current SNAPSHOT with maven and use that.

Command line Usage

Main.java is for direct command line usage. To use it, just download latest java-watch-build-0.2.0-shaded.jar from maven central or sonatype oss or build the project with maven and use the shaded jar from target folder. (I tried gradle few times, and it just does not fit me)

> java -jar java-watch-build-0.2.0-shaded.jar build.yml 

Shaded bundle (mini versus full)

Shaded jar includes all the dependencies to the jar is runnable standalone, this makes relatively large size jar, but is easy to use. Since version 0.3.0 The project builds 2 different shaded jars

  • full - (~16MB) all tasks
  • mini - (~5MB) excludes parts that are big but you might not need
    • @sass completely
    • @jsbundles works except JavaScript compiling (set outputJS: false)

if you use mini version and define @sass task you will get the following error:

problem starting config object#0 Sass compiling task is not available due to missing dependency hr.hrg:java-watch-sass (download full shaded version to fix or remove the @sass task)

also if you define @jsbundles task but do not change outputJS option to false

problem starting config object#0 JsBundles compiling JavaScript is not available due to missing dependency com.google.javascript:closure-compiler (download full shaded version to fix or set outputJS: false in the configuration)

you need to either remove that task from your build or download and use full version

Use in java code

Add maven dependency or download from maven central or download from sonatype oss

<dependency>
	<groupId>hr.hrg</groupId>
	<artifactId>java-watch-build</artifactId>
	<version>0.2.0</version>
</dependency>

misc

If you are by any chance looking for a sass build/watch tool for maven check: . I

License

See the LICENSE file for license rights and limitations (MIT).

import

Path resolving for import

Path relative to ${script_path} (must start with ./ or ../)

@import ./build1.yml 
@import ../fodler/other.yml 

Path relative to ${base_path}

@import build1.yml 
@import /build1.yml 

Versions

Version
0.2.0