Skip to content

Commit

Permalink
MONDRIAN: Ordering rules for olap4j imports.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 14728]
  • Loading branch information
julianhyde committed Oct 31, 2011
1 parent 05f132e commit e2838c4
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions bin/checkFile.awk
Expand Up @@ -193,6 +193,9 @@ FNR == 1 {
}
}

/^package / {
thisPackage = $2;
}
/^package / && previousLineWasEmpty {
error(fname, FNR, "'package' declaration must not occur after empty line");
}
Expand All @@ -207,19 +210,23 @@ FNR == 1 {
thisImport = $2;
gsub(/;/, "", thisImport);
gsub(/\*/, "", thisImport);
if (thisImport ~ /^mondrian/) {
importGroup = "a";
if (thisPackage ~ /^mondrian.*/ && thisImport ~ /^mondrian.*/ \
|| thisPackage ~ /^org.olap4j.*/ && thisImport ~ /^org.olap4j.*/)
{
importGroup = "a";
} else if (thisImport ~ /^static/) {
importGroup = "z";
} else if (thisImport ~ /^java/) {
} else if (thisImport ~ /^java.*/) {
importGroup = "y";
} else if (thisImport ~ /^junit/) {
} else if (thisImport ~ /^junit.*/) {
importGroup = "b";
} else if (thisImport ~ /^org.apache/) {
} else if (thisImport ~ /^mondrian.*/) {
importGroup = "bb";
} else if (thisImport ~ /^org.apache.*/) {
importGroup = "c";
} else if (thisImport ~ /^org.eigenbase/) {
} else if (thisImport ~ /^org.eigenbase.*/) {
importGroup = "d";
} else if (thisImport ~ /^org.olap4j/) {
} else if (thisImport ~ /^org.olap4j.*/) {
importGroup = "e";
} else {
importGroup = "f";
Expand Down

0 comments on commit e2838c4

Please sign in to comment.