From 146295a79ce075d0b83f0d0abc76e3c017321810 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sun, 18 Oct 2020 16:47:39 +0530 Subject: [PATCH 01/28] Add build pipeline stage for java in yml --- .travis.yml | 5 +++++ build.sh | 0 2 files changed, 5 insertions(+) create mode 100644 .travis.yml create mode 100644 build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1e056c9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: java +jdk: oraclejdk8 +script: + - javac advanced_java/tests/PlanetsTest.java + - java javac advanced_java/tests/PlanetsTest \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e69de29 From 9fe39320a1bfe3d689d515c6109b5e3a19727be8 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sun, 18 Oct 2020 16:51:10 +0530 Subject: [PATCH 02/28] Use openjdk8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e056c9..49d324d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: java -jdk: oraclejdk8 +jdk: openjdk8 script: - javac advanced_java/tests/PlanetsTest.java - java javac advanced_java/tests/PlanetsTest \ No newline at end of file From a03cb78059e663aaa10811432d0fce36e240a83f Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sun, 18 Oct 2020 16:52:12 +0530 Subject: [PATCH 03/28] Correct command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 49d324d..6782028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,4 @@ language: java jdk: openjdk8 script: - javac advanced_java/tests/PlanetsTest.java - - java javac advanced_java/tests/PlanetsTest \ No newline at end of file + - java advanced_java/tests/PlanetsTest \ No newline at end of file From 24d4a3054a64ac69be62d3b500665e229029bfc3 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sun, 18 Oct 2020 22:03:19 +0530 Subject: [PATCH 04/28] Move out the constants --- advanced_java/tests/PlanetsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced_java/tests/PlanetsTest.java b/advanced_java/tests/PlanetsTest.java index 5f08382..705edf6 100644 --- a/advanced_java/tests/PlanetsTest.java +++ b/advanced_java/tests/PlanetsTest.java @@ -8,6 +8,7 @@ import java.text.MessageFormat; class PlanetsTest { + private static String EARTH = "earth03"; private static String loggerMsg = "Assertion Failed: Expected {0} but found {1}"; public static void testEarth_WhenPlanetsGiven(Planets planets, String expected) { @@ -16,7 +17,7 @@ public static void testEarth_WhenPlanetsGiven(Planets planets, String expected) } public static void main(String[] args) { - testEarth_WhenPlanetsGiven(Planets.EARTH, "earth03"); + testEarth_WhenPlanetsGiven(Planets.EARTH, EARTH); } From d51ffffb2677dc3f4d0e2d2e69bd933f7fe2cb19 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Wed, 21 Oct 2020 23:08:34 +0530 Subject: [PATCH 05/28] Add build sh file and py file and structure --- build.py | 16 ++++++++++++++++ build.sh | 1 + 2 files changed, 17 insertions(+) create mode 100644 build.py diff --git a/build.py b/build.py new file mode 100644 index 0000000..13624fe --- /dev/null +++ b/build.py @@ -0,0 +1,16 @@ +class Build(object): + pass + + +class Test(object): + pass + + +class Compile(object): + pass + + +class Util(object): + def __init__(self): + pass + diff --git a/build.sh b/build.sh index e69de29..d8654aa 100644 --- a/build.sh +++ b/build.sh @@ -0,0 +1 @@ +python \ No newline at end of file From 0667d1e117aea182f40c03cd4394d7b943019dcf Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Thu, 22 Oct 2020 22:16:28 +0530 Subject: [PATCH 06/28] Build the pipeline methods and classes --- build.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 13624fe..ba45621 100644 --- a/build.py +++ b/build.py @@ -1,16 +1,23 @@ -class Build(object): +import logging + +class Stages: + def __init__(self, stage_name): + self.name = stage_name + + +class Build(Stages): pass -class Test(object): +class Test(Stages): pass -class Compile(object): +class Compile(Stages): pass -class Util(object): - def __init__(self): +class StageRunner: + def __init__(self, **kwargs): pass From 0185df086d55f4256e45eb2186d807ba22a14a91 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Fri, 23 Oct 2020 22:41:34 +0530 Subject: [PATCH 07/28] Add some content stage name here --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index ba45621..ddbea38 100644 --- a/build.py +++ b/build.py @@ -2,7 +2,10 @@ class Stages: def __init__(self, stage_name): - self.name = stage_name + self.stage_name = stage_name + + def __repr__(self): + print("repr: [name:{0}]".format(__name__)) class Build(Stages): From a2415c8d3de1d6da8e7f90f37169fdbf90444cb7 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 24 Oct 2020 18:27:58 +0530 Subject: [PATCH 08/28] Add skeleton and structure to the build class --- build.py | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index ddbea38..4b37a35 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,6 @@ import logging + class Stages: def __init__(self, stage_name): self.stage_name = stage_name @@ -7,20 +8,57 @@ def __init__(self, stage_name): def __repr__(self): print("repr: [name:{0}]".format(__name__)) + def run(self): + pass + class Build(Stages): - pass + __name__ = 'build' + def __init__(self, stage): + super().__init__(__name__) + + def run(self): + pass class Test(Stages): - pass + def __init__(self): + __name__ = 'test' + super().__init__(__name__) + def run(self): + pass class Compile(Stages): - pass + __name__ = 'compile' + def __init__(self): + super().__init__(stage_name=__name__) -class StageRunner: - def __init__(self, **kwargs): + def run(self): + #TODO Get the list of directories containing the py/java files + #TODO Compile/Run then one by one + #TODO Use a logger pass + +class StageRunner: + def __init__(self, *args): + """ + :param kwargs: dictionary of stages inheriting Stages class + """ + assert args is not None and len(args) != 0 + self.stages = args + + def run(self): + for stage in self.stages: + stage.run() + + def validate(self): + for stage in self.stages: + stage.run() + + +if __name__ == '__main__': + stage_runner = StageRunner() + stage_runner.run() \ No newline at end of file From 2a186dad91235c846bef938c321e0f513eb287d9 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 24 Oct 2020 18:56:29 +0530 Subject: [PATCH 09/28] Add utils method for the build proces --- build_utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 build_utils.py diff --git a/build_utils.py b/build_utils.py new file mode 100644 index 0000000..90954a6 --- /dev/null +++ b/build_utils.py @@ -0,0 +1,15 @@ +import os + + +def get_dirs(path='.'): + """ + + :param path: + :return: + """ + compilable_files = {} + for a, b, c in os.walk(os.getcwd()): + if "src" in a: + compilable_files[a] = [os.path.join(a, _file) for _file in c] + print(compilable_files) + return compilable_files From af932e449c1d668ebd7ce4c5ad056770094952a4 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 24 Oct 2020 18:59:28 +0530 Subject: [PATCH 10/28] Remove redundant params| Add documentation string for the method --- build_utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build_utils.py b/build_utils.py index 90954a6..0250fd5 100644 --- a/build_utils.py +++ b/build_utils.py @@ -1,11 +1,13 @@ import os -def get_dirs(path='.'): +def get_dirs(): """ - - :param path: - :return: + This method expects src/ to be present in the directories which want to + be compiled and tested. + It creates the paths to the files from the current working directory + so that it can be compiled from the current working directory. + :return: dictionary containing directories as keys and the files inside src/. """ compilable_files = {} for a, b, c in os.walk(os.getcwd()): From f0a0d8d13a919c5dd36dd691dcb54927de6ea6fc Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 24 Oct 2020 19:00:22 +0530 Subject: [PATCH 11/28] Use the method written in build_utils here to get hte dirs/files to compile/test/build/run --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 4b37a35..2d54a54 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,5 @@ import logging - +import build_utils class Stages: def __init__(self, stage_name): @@ -37,6 +37,7 @@ def __init__(self): def run(self): #TODO Get the list of directories containing the py/java files + _f = build_utils.get_dirs() #TODO Compile/Run then one by one #TODO Use a logger pass From 0f3e62ec8cf16a7fc37f751c229dd7073f1b6ce8 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 24 Oct 2020 19:03:01 +0530 Subject: [PATCH 12/28] Add some documentation --- build.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.py b/build.py index 2d54a54..a5e26d9 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,9 @@ import logging import build_utils +################################################################### +# BASE STAGE # +################################################################### class Stages: def __init__(self, stage_name): self.stage_name = stage_name @@ -12,6 +15,9 @@ def run(self): pass +################################################################### +# BUILD # +################################################################### class Build(Stages): __name__ = 'build' def __init__(self, stage): @@ -21,6 +27,9 @@ def run(self): pass +################################################################### +# TEST # +################################################################### class Test(Stages): def __init__(self): __name__ = 'test' @@ -29,6 +38,10 @@ def __init__(self): def run(self): pass + +################################################################### +# COMPILE # +################################################################### class Compile(Stages): __name__ = 'compile' @@ -43,6 +56,9 @@ def run(self): pass +################################################################### +# STAGES RUNNER # +################################################################### class StageRunner: def __init__(self, *args): """ @@ -60,6 +76,9 @@ def validate(self): stage.run() +################################################################### +# +################################################################### if __name__ == '__main__': stage_runner = StageRunner() stage_runner.run() \ No newline at end of file From c76ad0efce0f97e5da816aea68b93305e25b02fb Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 14:55:31 +0530 Subject: [PATCH 13/28] Add a utility method to create a new directory --- build_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build_utils.py b/build_utils.py index 0250fd5..c27ae54 100644 --- a/build_utils.py +++ b/build_utils.py @@ -15,3 +15,12 @@ def get_dirs(): compilable_files[a] = [os.path.join(a, _file) for _file in c] print(compilable_files) return compilable_files + + +def create_dir(path=None, name=None): + """ + Create a new directory in the directory given as path. + :param: Path where you want the new directory to be created. + :return: True if the path got created + """ + pass \ No newline at end of file From efa4d4f123a6afde27131ca8a83d851f9ff9a953 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 14:55:47 +0530 Subject: [PATCH 14/28] Add the javac compilation stage for the files --- build.py | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index a5e26d9..88ace94 100644 --- a/build.py +++ b/build.py @@ -43,18 +43,34 @@ def run(self): # COMPILE # ################################################################### class Compile(Stages): - __name__ = 'compile' + _name = 'compile' - def __init__(self): + def __init__(self, _files): super().__init__(stage_name=__name__) + self._files = _files + + def compile(self): + import os + print('Setting current working directory\t{}'.format(os.getcwd())) + try: + for _dir in self._files: + for _f in self._files[_dir]: + try: + if '.java' in _f: + os.system('javac {}'.format(_f)) + print('Compiled {}'.format(_f)) + except Exception as e: + #TODO Create a list of failed compiled files and print in the last. + continue + except Exception as e: + raise def run(self): - #TODO Get the list of directories containing the py/java files - _f = build_utils.get_dirs() + print("running {}".format(Compile._name)) #TODO Compile/Run then one by one + self.compile() #TODO Use a logger - pass - + print('Compilation done') ################################################################### # STAGES RUNNER # @@ -65,7 +81,8 @@ def __init__(self, *args): :param kwargs: dictionary of stages inheriting Stages class """ assert args is not None and len(args) != 0 - self.stages = args + self.stages = [stage(args[1]) for stage in args[0]] + self._files = args[1] def run(self): for stage in self.stages: @@ -80,5 +97,5 @@ def validate(self): # ################################################################### if __name__ == '__main__': - stage_runner = StageRunner() + stage_runner = StageRunner([Compile], build_utils.get_dirs()) stage_runner.run() \ No newline at end of file From 0ad2a931eef89b41aeae4c877fbde64c8087d56e Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 14:59:10 +0530 Subject: [PATCH 15/28] Pass build object as reference as well --- build.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 88ace94..53f57a5 100644 --- a/build.py +++ b/build.py @@ -8,8 +8,8 @@ class Stages: def __init__(self, stage_name): self.stage_name = stage_name - def __repr__(self): - print("repr: [name:{0}]".format(__name__)) + # def __repr__(self): + # print("repr: [name:{0}]".format(__name__)) def run(self): pass @@ -20,8 +20,9 @@ def run(self): ################################################################### class Build(Stages): __name__ = 'build' - def __init__(self, stage): - super().__init__(__name__) + def __init__(self, _files): + super().__init__(stage_name=__name__) + self._files = _files def run(self): pass @@ -97,5 +98,5 @@ def validate(self): # ################################################################### if __name__ == '__main__': - stage_runner = StageRunner([Compile], build_utils.get_dirs()) - stage_runner.run() \ No newline at end of file + stage_runner = StageRunner([Compile, Build], build_utils.get_dirs()) + # stage_runner.run() \ No newline at end of file From 11b7bb3156b730a8b913a4fb438ed0949e3e51e2 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 14:59:42 +0530 Subject: [PATCH 16/28] Ignore pyc files and pycache dir --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 83bfd14..3058ce6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +__pychache__/ +*pyc .DS_Store *iml *idea From ce5c55e25d136dda2d831107fc068c06ab113341 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 18:20:04 +0530 Subject: [PATCH 17/28] Add some logging | Write failed compilations into a file to fix those --- build.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 53f57a5..5dcec2a 100644 --- a/build.py +++ b/build.py @@ -54,20 +54,26 @@ def compile(self): import os print('Setting current working directory\t{}'.format(os.getcwd())) try: + failed_files = [] for _dir in self._files: for _f in self._files[_dir]: try: if '.java' in _f: - os.system('javac {}'.format(_f)) - print('Compiled {}'.format(_f)) + if (os.system('javac {}'.format(_f)) != 0): + failed_files.append(_f) + print('failed files length: \t{0}'.format(len(failed_files))) + print('Compiled files:\t {}'.format(_f)) except Exception as e: - #TODO Create a list of failed compiled files and print in the last. continue except Exception as e: raise + finally: + with open('failed_compilations', 'w') as ff: + ff.write('\n'.join(failed_files)) + print('Files failed compilation:\t {}'.format(len(failed_files))) def run(self): - print("running {}".format(Compile._name)) + print("Stage Running :\t {}".format(Compile._name)) #TODO Compile/Run then one by one self.compile() #TODO Use a logger @@ -99,4 +105,4 @@ def validate(self): ################################################################### if __name__ == '__main__': stage_runner = StageRunner([Compile, Build], build_utils.get_dirs()) - # stage_runner.run() \ No newline at end of file + stage_runner.run() \ No newline at end of file From d9d7941f2de89290d397f0bd6607dc9bb6c5799f Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 18:51:08 +0530 Subject: [PATCH 18/28] Add ignored param to ignore those files for now --- build.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/build.py b/build.py index 5dcec2a..de9d82c 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,8 @@ import logging import build_utils +logging.basicConfig(filename='ds.log', level=logging.INFO) + ################################################################### # BASE STAGE # ################################################################### @@ -8,9 +10,6 @@ class Stages: def __init__(self, stage_name): self.stage_name = stage_name - # def __repr__(self): - # print("repr: [name:{0}]".format(__name__)) - def run(self): pass @@ -46,38 +45,39 @@ def run(self): class Compile(Stages): _name = 'compile' - def __init__(self, _files): + def __init__(self, _files, _ignored): super().__init__(stage_name=__name__) self._files = _files + self._ignored = _ignored def compile(self): import os - print('Setting current working directory\t{}'.format(os.getcwd())) + logging.info('Setting current working directory\t{}'.format(os.getcwd())) try: failed_files = [] for _dir in self._files: for _f in self._files[_dir]: try: - if '.java' in _f: + if '.java' in _f and _f not in self._ignored: if (os.system('javac {}'.format(_f)) != 0): failed_files.append(_f) - print('failed files length: \t{0}'.format(len(failed_files))) - print('Compiled files:\t {}'.format(_f)) + logging.info('failed files length: \t{0}'.format(len(failed_files))) + logging.info('Compiled files:\t {}'.format(_f)) except Exception as e: continue except Exception as e: raise finally: - with open('failed_compilations', 'w') as ff: - ff.write('\n'.join(failed_files)) - print('Files failed compilation:\t {}'.format(len(failed_files))) + if len(failed_files) != 0: + with open('failed_compilations', 'w') as ff: + ff.write('\n'.join(failed_files)) + logging.error('COMPILATION FAILED FOR {} FILES'.format(len(failed_files))) def run(self): - print("Stage Running :\t {}".format(Compile._name)) - #TODO Compile/Run then one by one + logging.info("RUNNING STAGE:\t {}".format(Compile._name)) self.compile() #TODO Use a logger - print('Compilation done') + logging.info('COMPILATION COMPLETE') ################################################################### # STAGES RUNNER # @@ -88,8 +88,9 @@ def __init__(self, *args): :param kwargs: dictionary of stages inheriting Stages class """ assert args is not None and len(args) != 0 - self.stages = [stage(args[1]) for stage in args[0]] + self.stages = [stage(args[1], args[2]) for stage in args[0]] self._files = args[1] + self.ignored = args[2] def run(self): for stage in self.stages: @@ -104,5 +105,10 @@ def validate(self): # ################################################################### if __name__ == '__main__': - stage_runner = StageRunner([Compile, Build], build_utils.get_dirs()) + _files = build_utils.get_dirs() + _ff = open('failed_compilations', 'r') + _fflist = _ff.readlines() + _ff.close() + + stage_runner = StageRunner([Compile], _files, _ff) stage_runner.run() \ No newline at end of file From 1d3978a096c51ac2aa2e2d549f8d3c294780ce65 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 20:35:13 +0530 Subject: [PATCH 19/28] Update the build environment | logging level to error --- .travis.yml | 5 +++-- build.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6782028..eed5a40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: java jdk: openjdk8 +language: python + - "3.7" script: - - javac advanced_java/tests/PlanetsTest.java - - java advanced_java/tests/PlanetsTest \ No newline at end of file + - python build.py \ No newline at end of file diff --git a/build.py b/build.py index de9d82c..659d96a 100644 --- a/build.py +++ b/build.py @@ -1,7 +1,7 @@ import logging import build_utils -logging.basicConfig(filename='ds.log', level=logging.INFO) +logging.basicConfig(filename='ds.log', level=logging.ERROR) ################################################################### # BASE STAGE # From c5dc4099409a6a21edc78cf552b57c483510d010 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Mon, 26 Oct 2020 21:29:16 +0530 Subject: [PATCH 20/28] Add file for failed compilations --- failed_compilations | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 failed_compilations diff --git a/failed_compilations b/failed_compilations new file mode 100644 index 0000000..e69de29 From 01a21c322508c1fd32b3d343423f09e4504252bd Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 7 Nov 2020 19:29:35 +0530 Subject: [PATCH 21/28] Add build pipeline code | Add a new file whichs tores the failed compilations file --- .gitignore | 1 + build.py | 10 ++++++---- build_utils.py | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3058ce6..4e61c86 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ __pychache__/ *iml *idea *.class +target/* diff --git a/build.py b/build.py index 659d96a..22cadd9 100644 --- a/build.py +++ b/build.py @@ -59,7 +59,7 @@ def compile(self): for _f in self._files[_dir]: try: if '.java' in _f and _f not in self._ignored: - if (os.system('javac {}'.format(_f)) != 0): + if os.system('javac {} -d target'.format(_f)) != 0: failed_files.append(_f) logging.info('failed files length: \t{0}'.format(len(failed_files))) logging.info('Compiled files:\t {}'.format(_f)) @@ -76,7 +76,6 @@ def compile(self): def run(self): logging.info("RUNNING STAGE:\t {}".format(Compile._name)) self.compile() - #TODO Use a logger logging.info('COMPILATION COMPLETE') ################################################################### @@ -93,13 +92,17 @@ def __init__(self, *args): self.ignored = args[2] def run(self): + self.create_dir() for stage in self.stages: + print('run') stage.run() def validate(self): for stage in self.stages: stage.run() + def create_dir(self): + build_utils.create_dir('target') ################################################################### # @@ -109,6 +112,5 @@ def validate(self): _ff = open('failed_compilations', 'r') _fflist = _ff.readlines() _ff.close() - - stage_runner = StageRunner([Compile], _files, _ff) + stage_runner = StageRunner([Compile], _files, _fflist) stage_runner.run() \ No newline at end of file diff --git a/build_utils.py b/build_utils.py index c27ae54..fee25b0 100644 --- a/build_utils.py +++ b/build_utils.py @@ -23,4 +23,5 @@ def create_dir(path=None, name=None): :param: Path where you want the new directory to be created. :return: True if the path got created """ - pass \ No newline at end of file + if not os.path.exists(path): + os.makedirs(path) \ No newline at end of file From b3067488fbc81800f6a48ecbe16c178ecbb3d7f3 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 7 Nov 2020 19:29:49 +0530 Subject: [PATCH 22/28] file for failed compilations --- failed_compilations | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/failed_compilations b/failed_compilations index e69de29..f675d14 100644 --- a/failed_compilations +++ b/failed_compilations @@ -0,0 +1,38 @@ +/home/sid/github/datastructures/trie/src/Boggle.java +/home/sid/github/datastructures/trie/src/EnglishDictionary.java +/home/sid/github/datastructures/trie/src/AutoComplete.java +/home/sid/github/datastructures/trie/src/LongestCommonPrefix.java +/home/sid/github/datastructures/trie/src/LongestPrefixMatching.java +/home/sid/github/datastructures/queue/src/QueueImplementer.java +/home/sid/github/datastructures/queue/src/QueueHelper.java +/home/sid/github/datastructures/problem_solving/src/SudokuTester.java +/home/sid/github/datastructures/problem_solving/src/KruskalMST.java +/home/sid/github/datastructures/problem_solving/src/SnakeAndLadder.java +/home/sid/github/datastructures/problem_solving/src/GCDOfArray.java +/home/sid/github/datastructures/problem_solving/src/MergeNewInterval.java +/home/sid/github/datastructures/problem_solving/src/MinimumCostToConnectCities.java +/home/sid/github/datastructures/sorts/src/Partitioning.java +/home/sid/github/datastructures/sorts/src/Analysis.java +/home/sid/github/datastructures/sorts/src/MergeSort.java +/home/sid/github/datastructures/sudoku-solver/src/SudokuTester.java +/home/sid/github/datastructures/stacks/src/StackHelper.java +/home/sid/github/datastructures/stacks/src/TwoStackClassHelper.java +/home/sid/github/datastructures/arrays/src/MoveZero.java +/home/sid/github/datastructures/arrays/src/MaximumMinimumForm.java +/home/sid/github/datastructures/arrays/src/ReplaceEveryElementWithGreatestOnRight.java +/home/sid/github/datastructures/arrays/src/BinarySearchRotateArray.java +/home/sid/github/datastructures/arrays/src/RotateArrayQuickly.java +/home/sid/github/datastructures/arrays/src/Stub.java +/home/sid/github/datastructures/arrays/src/LarThreeElements.java +/home/sid/github/datastructures/arrays/src/ReplaceElementWithMultiplicationOfPreviousAndNext.java +/home/sid/github/datastructures/arrays/src/SubMatrixSumQuery.java +/home/sid/github/datastructures/arrays/src/MinDistBetweenNumbers.java +/home/sid/github/datastructures/arrays/src/Pivot.java +/home/sid/github/datastructures/arrays/src/ShuffleArray.java +/home/sid/github/datastructures/binary_tree/src/HeightBalancedTree.java +/home/sid/github/datastructures/binary_tree/src/PathSum.java +/home/sid/github/datastructures/heaps/src/PriorityQueue.java +/home/sid/github/datastructures/heaps/src/HeapSort.java +/home/sid/github/datastructures/heaps/src/HeapImplementer.java +/home/sid/github/datastructures/linked_list/src/DeleteNodeClass.java +/home/sid/github/datastructures/disjoint_set/src/FriendCircleQuery.java \ No newline at end of file From 5857d0dbb4aa1320400233a3947fde42f5bd1e2c Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 7 Nov 2020 19:30:11 +0530 Subject: [PATCH 23/28] ignore log files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4e61c86..0ac80aa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ __pychache__/ *idea *.class target/* +*.log From 22ca6b242318cf6a56673253e2d432e2a8579f90 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 7 Nov 2020 19:45:09 +0530 Subject: [PATCH 24/28] remvoe unused file --- build.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 build.sh diff --git a/build.sh b/build.sh deleted file mode 100644 index d8654aa..0000000 --- a/build.sh +++ /dev/null @@ -1 +0,0 @@ -python \ No newline at end of file From 7caf798b9a747190c42e1b3961e7ef18e3ff8aeb Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 14 Nov 2020 23:45:19 +0530 Subject: [PATCH 25/28] Fix compilation issues --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 22cadd9..c66a645 100644 --- a/build.py +++ b/build.py @@ -19,6 +19,7 @@ def run(self): ################################################################### class Build(Stages): __name__ = 'build' + def __init__(self, _files): super().__init__(stage_name=__name__) self._files = _files @@ -69,7 +70,7 @@ def compile(self): raise finally: if len(failed_files) != 0: - with open('failed_compilations', 'w') as ff: + with open('failed_compilations', 'a') as ff: ff.write('\n'.join(failed_files)) logging.error('COMPILATION FAILED FOR {} FILES'.format(len(failed_files))) From cfdc88e65dd77988f14b653337e525b011caa409 Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 14 Nov 2020 23:45:29 +0530 Subject: [PATCH 26/28] Add util method --- build_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_utils.py b/build_utils.py index fee25b0..cd80c08 100644 --- a/build_utils.py +++ b/build_utils.py @@ -1,5 +1,5 @@ import os - +import requests def get_dirs(): """ From 15c286171be7d7df7cf8313205b301d7ccefddcd Mon Sep 17 00:00:00 2001 From: SiddharthaAnand Date: Sat, 14 Nov 2020 23:45:41 +0530 Subject: [PATCH 27/28] Failing compilation files to be fixed later --- failed_compilations | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/failed_compilations b/failed_compilations index f675d14..18a496d 100644 --- a/failed_compilations +++ b/failed_compilations @@ -1,22 +1,15 @@ -/home/sid/github/datastructures/trie/src/Boggle.java -/home/sid/github/datastructures/trie/src/EnglishDictionary.java -/home/sid/github/datastructures/trie/src/AutoComplete.java -/home/sid/github/datastructures/trie/src/LongestCommonPrefix.java -/home/sid/github/datastructures/trie/src/LongestPrefixMatching.java +/home/sid/github/datastructures/linked_list/src/DeleteNodeClass.java +/home/sid/github/datastructures/disjoint_set/src/FriendCircleQuery.java /home/sid/github/datastructures/queue/src/QueueImplementer.java /home/sid/github/datastructures/queue/src/QueueHelper.java -/home/sid/github/datastructures/problem_solving/src/SudokuTester.java -/home/sid/github/datastructures/problem_solving/src/KruskalMST.java -/home/sid/github/datastructures/problem_solving/src/SnakeAndLadder.java -/home/sid/github/datastructures/problem_solving/src/GCDOfArray.java -/home/sid/github/datastructures/problem_solving/src/MergeNewInterval.java -/home/sid/github/datastructures/problem_solving/src/MinimumCostToConnectCities.java +/home/sid/github/datastructures/stacks/src/StackHelper.java +/home/sid/github/datastructures/stacks/src/TwoStackClassHelper.java +/home/sid/github/datastructures/sudoku-solver/src/SudokuTester.java +/home/sid/github/datastructures/binary_tree/src/HeightBalancedTree.java +/home/sid/github/datastructures/binary_tree/src/PathSum.java /home/sid/github/datastructures/sorts/src/Partitioning.java /home/sid/github/datastructures/sorts/src/Analysis.java /home/sid/github/datastructures/sorts/src/MergeSort.java -/home/sid/github/datastructures/sudoku-solver/src/SudokuTester.java -/home/sid/github/datastructures/stacks/src/StackHelper.java -/home/sid/github/datastructures/stacks/src/TwoStackClassHelper.java /home/sid/github/datastructures/arrays/src/MoveZero.java /home/sid/github/datastructures/arrays/src/MaximumMinimumForm.java /home/sid/github/datastructures/arrays/src/ReplaceEveryElementWithGreatestOnRight.java @@ -29,10 +22,18 @@ /home/sid/github/datastructures/arrays/src/MinDistBetweenNumbers.java /home/sid/github/datastructures/arrays/src/Pivot.java /home/sid/github/datastructures/arrays/src/ShuffleArray.java -/home/sid/github/datastructures/binary_tree/src/HeightBalancedTree.java -/home/sid/github/datastructures/binary_tree/src/PathSum.java +/home/sid/github/datastructures/trie/src/Boggle.java +/home/sid/github/datastructures/trie/src/EnglishDictionary.java +/home/sid/github/datastructures/trie/src/AutoComplete.java +/home/sid/github/datastructures/trie/src/LongestCommonPrefix.java +/home/sid/github/datastructures/trie/src/LongestPrefixMatching.java +/home/sid/github/datastructures/linked_list/src/DeleteNodeClass.java +/home/sid/github/datastructures/problem_solving/src/SudokuTester.java +/home/sid/github/datastructures/problem_solving/src/KruskalMST.java +/home/sid/github/datastructures/problem_solving/src/SnakeAndLadder.java +/home/sid/github/datastructures/problem_solving/src/GCDOfArray.java +/home/sid/github/datastructures/problem_solving/src/MergeNewInterval.java +/home/sid/github/datastructures/problem_solving/src/MinimumCostToConnectCities.java /home/sid/github/datastructures/heaps/src/PriorityQueue.java /home/sid/github/datastructures/heaps/src/HeapSort.java -/home/sid/github/datastructures/heaps/src/HeapImplementer.java -/home/sid/github/datastructures/linked_list/src/DeleteNodeClass.java -/home/sid/github/datastructures/disjoint_set/src/FriendCircleQuery.java \ No newline at end of file +/home/sid/github/datastructures/heaps/src/HeapImplementer.java \ No newline at end of file From 163343a103a720e295815fda3ad8fb88e72c6297 Mon Sep 17 00:00:00 2001 From: Siddhartha Anand Date: Sun, 15 Nov 2020 19:06:03 +0530 Subject: [PATCH 28/28] Update build_utils.py Remove unused imports. --- build_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build_utils.py b/build_utils.py index cd80c08..b4445a6 100644 --- a/build_utils.py +++ b/build_utils.py @@ -1,5 +1,4 @@ import os -import requests def get_dirs(): """ @@ -24,4 +23,4 @@ def create_dir(path=None, name=None): :return: True if the path got created """ if not os.path.exists(path): - os.makedirs(path) \ No newline at end of file + os.makedirs(path)