Place this app in nextcloud/apps/.
makephpfor Composer fallback installationcomposer, orcurlplusphpso the Makefile can download Composer locallynpmtarfor source and app store archives
The JavaScript build is tested with Node.js 20 and npm 10. Newer runtimes may work, but npm can warn when package engine ranges do not match the supported build runtime.
Run the full build from the app root:
makeThe Makefile runs Composer when composer.json is present and runs npm ci && npm run build for the JavaScript assets in js/.
Tool commands can be overridden without editing the Makefile:
make PHP=/usr/local/bin/php COMPOSER=/usr/local/bin/composer NPM=/usr/local/bin/npmIf Composer is not installed, the Makefile downloads Composer into build/tools/ and runs it with php. The PHP command defaults to php, not a versioned binary such as php-8.2.
From js/:
npm ci
npm run buildUseful scripts:
npm run build: production Webpack buildnpm run build:dev: development Webpack buildnpm run audit: audit the lockfile without modifying dependencies
Build source and app store archives:
make distThe archive command defaults to tar. If your platform needs a different command or tar option set, override it:
make appstore TAR=gtar
make appstore TAR_OWNER_ARGS=The Package GitHub Actions workflow builds a downloadable appstore tarball.
To build a short-lived Actions artifact on demand:
- Open the repository on GitHub.
- Go to Actions.
- Select Package.
- Click Run workflow.
- Download the
timetracker-appstore-packageartifact from the completed run.
The artifact contains:
timetracker.tar.gz: app package fornextcloud/apps/timetracker.tar.gz.sha256: checksum for the package
The package includes production Composer autoload files, including vendor/autoload.php and vendor/composer/.
To publish a durable GitHub Release, push a tag matching v*. The workflow attaches the same tarball and checksum to the release.
The PHP tests need a Nextcloud server checkout because the test bootstrap loads Nextcloud internals from lib/base.php.
Create a local test harness:
git clone --recursive --branch stable34 https://github.com/nextcloud/server.git nextcloud
cd nextcloud
composer install --no-dev --prefer-dist --no-interaction
cd vendor-bin/phpunit
composer install --prefer-dist --no-interaction
cd ../../
php occ maintenance:install --database sqlite --admin-user admin --admin-pass admin
cd /path/to/timetracker
make nextcloud-link NEXTCLOUD_ROOT=/path/to/nextcloud
cd /path/to/nextcloud
php occ app:enable timetracker
cd /path/to/timetracker
make test NEXTCLOUD_ROOT=/path/to/nextcloudWhen the app already lives under nextcloud/apps/timetracker, the shorter form is:
make testThe Makefile defaults to Nextcloud's PHPUnit binary at NEXTCLOUD_ROOT/vendor-bin/phpunit/vendor/bin/phpunit. Override PHPUNIT=/path/to/phpunit if needed.
When the app is not physically located at nextcloud/apps/timetracker, either create the symlink yourself or use:
make nextcloud-link NEXTCLOUD_ROOT=/path/to/nextcloud