forked from MilosSubotic/LPRS2_2024
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwscript
More file actions
47 lines (38 loc) · 1.05 KB
/
wscript
File metadata and controls
47 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
@author: Milos Subotic <milos.subotic.sm@gmail.com>
@license: MIT
@brief: Waf script just for distclean and dist commands.
'''
###############################################################################
import os
import datetime
import waflib
###############################################################################
APPNAME = os.path.basename(os.getcwd())
def distclean(ctx):
os.system('git clean -dfX')
def dist(ctx):
APPNAME = os.path.basename(os.getcwd())
now = datetime.datetime.now()
time_stamp = '{:d}-{:02d}-{:02d}-{:02d}-{:02d}-{:02d}'.format(
now.year,
now.month,
now.day,
now.hour,
now.minute,
now.second
)
ctx.arch_name = '../{}-{}.zip'.format(APPNAME, time_stamp)
ctx.algo = 'zip'
ctx.base_name = APPNAME
# Also pack git.
waflib.Node.exclude_regs = waflib.Node.exclude_regs.replace(
'''
**/.git
**/.git/**
**/.gitignore''', '')
# Ignore waf's stuff.
waflib.Node.exclude_regs += '\n**/.waf*'
###############################################################################