Skip to content

Commit

Permalink
Little more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgodbe committed Oct 17, 2019
1 parent ae96288 commit c9af80b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MakeReferencePropsFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static void main(String[] args) throws IOException{
ArrayList<File> extFiles = new ArrayList<File>();
listAllFiles("E:\\code\\aspnet\\extensions\\src", extFiles);

//Maps AspNetCore projects to ProjectReferences
HashMap<String, HashSet<String>> refs = new HashMap<String, HashSet<String>>();
for (File f: files){
Scanner fileScan = new Scanner(f);
Expand All @@ -34,6 +35,7 @@ public static void main(String[] args) throws IOException{
refs.put(k, v);
}

//Maps Extensions projects to projectReferences
HashMap<String, HashSet<String>> extRefs = new HashMap<String, HashSet<String>>();
for (File f: extFiles){
Scanner fileScan = new Scanner(f);
Expand All @@ -51,6 +53,7 @@ public static void main(String[] args) throws IOException{
extRefs.put(k2, v2);
}

//If an AspNetCore proj references an Extensions proj, add the Extensions proj's refs to the AspNetCore proj's refs
for (String s1: refs.keySet()){
HashSet<String> temp = new HashSet<String>();
for (String s2: refs.get(s1)){
Expand All @@ -61,6 +64,17 @@ public static void main(String[] args) throws IOException{
refs.get(s1).addAll(temp);
}

//If an AspNetCore proj references another AspNetCore proj, add the child proj's refs to the parent proj's refs
for (String s1: refs.keySet()){
HashSet<String> temp = new HashSet<String>();
for (String s2: refs.get(s1)){
if (refs.containsKey(s2)){
temp.addAll(refs.get(s2));
}
}
refs.get(s1).addAll(temp);
}

BufferedWriter bw = new BufferedWriter(new FileWriter(new File(
"E:\\code\\scratch\\IndirectReferences.props"), true));
bw.write("<Project>");
Expand Down

0 comments on commit c9af80b

Please sign in to comment.