Skip to content

Commit

Permalink
doc: fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Jul 9, 2024
1 parent 21b34f7 commit 7db1f7b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* </p>
*
* @author null8626
* @version 3.2.3
* @since 3.0.0
*/
public class CuredString {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* A match yielded by the CuredString.find() method.
*
* @author null8626
* @version 3.2.3
* @since 3.1.0
*/
public class Match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* </p>
*
* @author null8626
* @version 3.2.3
* @since 3.0.0
*/
public final class Options {
Expand Down
2 changes: 1 addition & 1 deletion bindings/native/decancer.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* @module decancer
* @file decancer.h
* @brief A library that removes common unicode confusables/homoglyphs from strings.
* @author null8626
* @copyright Copyright (c) 2021-2024 null8626
* @date 2024-07-09
* @version 3.2.3
* @see https://github.com/null8626/decancer
*/

#ifndef __DECANCER_H__
Expand Down
18 changes: 15 additions & 3 deletions scripts/version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { fileURLToPath } from 'node:url'
const ROOT_DIR = join(dirname(fileURLToPath(import.meta.url)), '..')
const CORE_DIR = join(ROOT_DIR, 'core')
const NODE_DIR = join(ROOT_DIR, 'bindings', 'node')
const JAVA_SOURCES_DIR = join(ROOT_DIR, 'bindings', 'java', 'src', 'main', 'java', 'io', 'github', 'null8626', 'decancer')
const JRELEASER_VERSION = '1.12.0'

async function update(filename, callback) {
Expand All @@ -35,22 +36,24 @@ const updateTomlFunc = x =>
x.replace(/version = "\d+\.\d+\.\d+"/, `version = "${process.argv[2]}"`)
const directUpdateFunc = x => x.replace(/\d\.\d\.\d/g, process.argv[2])

const updateDocStringVersionFunc = x => x.replace(/@version \d\.\d\.\d/, `@version ${process.argv[2]}`)

function updateNativeHeaderFunc(x) {
const versionHex = `0x${process.argv[2]
.split('.')
.map(x => x.padStart(2, '0'))
.join('')}`

return x
return updateDocStringVersionFunc(x
.replace(
/#define DECANCER_VERSION 0x[a-fA-F0-9]{6}/,
`#define DECANCER_VERSION ${versionHex}`
)
.replace(
/@date \d{4}\-\d{2}\-\d{2}/,
`@date ${new Date().toISOString().replace(/T[\d\:\.]+Z$/, '')}`
)
.replace(/\d\.\d\.\d/, process.argv[2])
))

}

void (await Promise.all([
Expand Down Expand Up @@ -86,5 +89,14 @@ void (await Promise.all([
)
).then(resolve)
})
}),
new Promise(resolve => {
readdir(JAVA_SOURCES_DIR).then(files => {
Promise.all(
files.map(file =>
update(join(JAVA_SOURCES_DIR, file), updateDocStringVersionFunc)
)
).then(resolve)
})
})
]))

0 comments on commit 7db1f7b

Please sign in to comment.