-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathstat_attributes.py
51 lines (39 loc) · 2.06 KB
/
stat_attributes.py
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
48
49
50
51
#!/usr/bin/env python
# SPDX-FileCopyrightText: (c) 2020 Western Digital Corporation or its affiliates,
# Arseniy Aharonov <[email protected]>
#
# SPDX-License-Identifier: MIT
# ----------------------------------------------------------------------------------------------------------------------
VERSION = '2.2.0'
WEB_URL = "https://github.com/westerndigitalcorporation/stat#3-usage"
RESOURCES_DIRECTORY = 'resources'
DUMMIES_DIRECTORY = 'dummies'
PRODUCT_DIRECTORY = 'products'
LOGS_DIRECTORY = 'logs'
IDE_DIRECTORY = 'ide'
OUTPUT_DIRECTORY = 'output'
REPORT_FILENAME = 'report.json'
IGNORE_FILENAME = '.statignore'
CONFIG_FILENAME = '.statconfig'
AUTO_GENERATED_MAKEFILE = '/'.join([OUTPUT_DIRECTORY, "stat.mak"])
REBUILD_TARGET = 'rebuild'
CLEAN_TARGET = 'clean'
OUTPUT_SUB_DIRECTORIES = ['inc', 'obj', 'bin']
ALL_OUTPUT_DIRECTORIES = [OUTPUT_DIRECTORY, IDE_DIRECTORY, LOGS_DIRECTORY]
# ----------------------------------------------------------------------------------------------------------------------
class __AutoGeneratedAttributes(object):
from os import path # Prevent porting by those which import this file
def __init__(self):
self.toolPath = self.path.abspath(self.path.dirname(self.path.abspath(__file__)))
self.makeTools = self.__listMakeTools()
def __listMakeTools(self):
makeTools = ("Windows32", "gnumake32.exe"), ("Windows64", "gnumake.exe"), ("Linux64", "make")
makeTools = ((platform, self.path.join(self.toolPath, RESOURCES_DIRECTORY, "gmake", filename))
for platform, filename in makeTools)
makeTools = {platform: toolPath for platform, toolPath in makeTools if self.path.isfile(toolPath)}
return makeTools
# ----------------------------------------------------------------------------------------------------------------------
__attributes = __AutoGeneratedAttributes()
TOOL_PATH = __attributes.toolPath
MAKE_TOOL = __attributes.makeTools
# ----------------------------------------------------------------------------------------------------------------------