Skip to content

Commit

Permalink
Use version string from v.mod for the plugin version.
Browse files Browse the repository at this point in the history
  • Loading branch information
odiroot committed Jan 20, 2024
1 parent dc0e2e0 commit d4f98e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
* Plugin version is now source from V mod file.

## [0.1.2] - 2024-01-20
### Changed
* Using proper struct casting for event header when processing.
Expand Down
10 changes: 8 additions & 2 deletions src/main.v
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import log
import v.vmod

// Only need to change the mod file to update the version.
const manifest = vmod.decode(@VMOD_FILE) or { panic(err) }
const current_version = manifest.version

// Exposes the plugin to the host (DAW).

@[markused]
__global clap_entry = plugin_entry
// This requires modification to `clap/entry.h`.
// Remove "const" so you get:
// CLAP_EXPORT extern clap_plugin_entry_t clap_entry;
@[markused]
__global clap_entry = plugin_entry

fn init() {
$if debug {
Expand Down
2 changes: 1 addition & 1 deletion src/setup.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const _plugin_descriptor = C.clap_plugin_descriptor_t{
id: _plugin_id.str
name: c'CLAP V Hello World'
vendor: c'MOFOSS'
version: c'0.1.0'
version: current_version.str
description: c'MVP of a CLAP plugin in V.'
// voidptr is to fix warning about const char**.
features: voidptr(unsafe {
Expand Down

0 comments on commit d4f98e0

Please sign in to comment.