Skip to content

Commit

Permalink
Merge pull request #28 from aas-integration/map2anno-solveMultiDecl
Browse files Browse the repository at this point in the history
Solved multiple declarations failed compilation issue in map2annotation
  • Loading branch information
martinschaef authored Dec 11, 2016
2 parents 6cf6bd1 + 200c09a commit 2c378e1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
17 changes: 17 additions & 0 deletions map2annotation/fetch_map2anno_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
MAP2ANNO_DIR=$(cd $(dirname "$0") && pwd)

##### build hacked checkstyle
if [ ! -d $MAP2ANNO_DIR/checkstyle ] ; then
# rm -rf $MAP2ANNO_DIR/checkstyle
(cd $MAP2ANNO_DIR && git clone --depth 1 --branch multiDeclJson https://github.com/CharlesZ-Chen/checkstyle.git)
(cd $MAP2ANNO_DIR/checkstyle && mvn clean package -Passembly)
fi
(cd $MAP2ANNO_DIR/checkstyle && git pull)

##### fetch refactor front-end
if [ ! -d $MAP2ANNO_DIR/multiDeclRefactor ] ; then
# rm -rf $MAP2ANNO_DIR/multiDeclRefactor
(cd $MAP2ANNO_DIR && git clone --depth 1 https://github.com/CharlesZ-Chen/multiDeclRefactor.git)
fi
(cd $MAP2ANNO_DIR/multiDeclRefactor && git pull)
21 changes: 17 additions & 4 deletions map2annotation/map2annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,24 @@ def field_mappings_to_annotation(json_file):

corpus_jaif_file = create_corpus_jaif(mappings)

# for project in project_list:
# insert_anno_to_project(project, corpus_jaif_file)
for project in project_list:
refactor_multi_decl(project)

for project in project_list:
insert_anno_to_project(project, corpus_jaif_file)

for project in project_list:
frontend_pa_inference.run_inference(project)

def refactor_multi_decl(project):
project_dir = common.get_project_dir(project)
refactor_script = os.path.join(MAP_WORKING_DIR, "multiDeclRefactor", "run-refactor.sh")
refactor_cmd = [refactor_script, project_dir]
common.run_cmd(refactor_cmd)

# for project in project_list:
# frontend_pa_inference.run_inference(project)
def init_multi_decl_refactor():
FETCH_TOOL_SCRIPT = os.path.join(MAP_WORKING_DIR, "fetch_map2anno_tools.sh")
common.run_cmd(FETCH_TOOL_SCRIPT)

def type_mappings_to_rules(json_file):
with open(json_file) as data_file:
Expand Down

0 comments on commit 2c378e1

Please sign in to comment.