tool: setup thirdparty 'freetype'

pull/3831/head
yuyi 2020-02-25 01:01:35 +08:00 committed by GitHub
parent ef8c1203b4
commit aae14f4eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,29 @@
module main
import (
os
filepath
v.pref
)
fn main() {
$if windows {
println('Setup freetype...')
vroot := filepath.dir(pref.vexe_path())
os.chdir(vroot)
if os.is_dir('./thirdparty/freetype') {
println('Thirdparty "freetype" is already installed.')
}
else {
s := os.exec('git clone --depth=1 https://github.com/ubawurinna/freetype-windows-binaries ./thirdparty/freetype/') or {
panic(err)
}
println(s.output)
println('Thirdparty "freetype" installed successfully.')
}
}
$else {
println('It is only for Windows to setup thirdparty "freetype".')
}
}

View File

@ -35,6 +35,8 @@ The commands are:
test-fmt test if all files in the current directory is formatted properly
test-compiler run the V self-test suite to make sure V is working properly
setup-freetype setup thirdparty freetype on Windows
For a comprehensive list of options, please refer to `v help --verbose`.'
//Use "v help <command>" for more information about a command.'
//TODO When docs have been written for all the subcommands, delete the verbose help text and
@ -116,6 +118,7 @@ Commands:
doc Run vdoc over the source code and produce documentation.
translate Translates C to V. [wip, will be available in V 0.3]
create Create a new v project interactively. Answer the questions, and run it with `v run projectname`
setup-freetype Setup thirdparty freetype on Windows.
V package management commands:
search keywords Search the https://vpm.vlang.io/ module repository for matching modules and shows their details.
@ -128,4 +131,3 @@ V package management commands:
- To disable automatic formatting:
v -nofmt file.v
*/

View File

@ -18,7 +18,8 @@ const (
'test', 'test-fmt', 'test-compiler',
'bin2v',
'repl',
'build-tools', 'build-examples', 'build-vbinaries']
'build-tools', 'build-examples', 'build-vbinaries',
'setup-freetype']
)
fn main() {