Mercurial > hg > graal-compiler
comparison mxtool/mx.py @ 18393:a4ab0b87fb34
Make distribution dependencies also exclude libraries
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 16 Sep 2014 15:06:32 +0200 |
parents | c88ab4f1f04a |
children | e97e1f07a3d6 |
comparison
equal
deleted
inserted
replaced
18392:3ad5d7a6adb5 | 18393:a4ab0b87fb34 |
---|---|
134 manifest = "Manifest-Version: 1.0\nMain-Class: %s\n\n" % (self.mainClass) | 134 manifest = "Manifest-Version: 1.0\nMain-Class: %s\n\n" % (self.mainClass) |
135 if not overwriteCheck(arc.zf, "META-INF/MANIFEST.MF", "project files"): | 135 if not overwriteCheck(arc.zf, "META-INF/MANIFEST.MF", "project files"): |
136 arc.zf.writestr("META-INF/MANIFEST.MF", manifest) | 136 arc.zf.writestr("META-INF/MANIFEST.MF", manifest) |
137 | 137 |
138 for dep in self.sorted_deps(includeLibs=True): | 138 for dep in self.sorted_deps(includeLibs=True): |
139 isCoveredByDependecy = False | |
140 for d in self.distDependencies: | |
141 if dep in _dists[d].sorted_deps(includeLibs=True, transitive=True): | |
142 logv("Excluding {0} from {1} because it's provided by the dependency {2}".format(dep.name, self.path, d)) | |
143 isCoveredByDependecy = True | |
144 break | |
145 | |
146 if isCoveredByDependecy: | |
147 continue | |
148 | |
139 if dep.isLibrary(): | 149 if dep.isLibrary(): |
140 l = dep | 150 l = dep |
141 # merge library jar into distribution jar | 151 # merge library jar into distribution jar |
142 logv('[' + self.path + ': adding library ' + l.name + ']') | 152 logv('[' + self.path + ': adding library ' + l.name + ']') |
143 lpath = l.get_path(resolve=True) | 153 lpath = l.get_path(resolve=True) |
157 for arcname in lp.namelist(): | 167 for arcname in lp.namelist(): |
158 if not overwriteCheck(srcArc.zf, arcname, lpath + '!' + arcname): | 168 if not overwriteCheck(srcArc.zf, arcname, lpath + '!' + arcname): |
159 srcArc.zf.writestr(arcname, lp.read(arcname)) | 169 srcArc.zf.writestr(arcname, lp.read(arcname)) |
160 elif dep.isProject(): | 170 elif dep.isProject(): |
161 p = dep | 171 p = dep |
162 | |
163 isCoveredByDependecy = False | |
164 for d in self.distDependencies: | |
165 if p in _dists[d].sorted_deps(): | |
166 logv("Excluding {0} from {1} because it's provided by the dependency {2}".format(p.name, self.path, d)) | |
167 isCoveredByDependecy = True | |
168 break | |
169 | |
170 if isCoveredByDependecy: | |
171 continue | |
172 | 172 |
173 if self.javaCompliance: | 173 if self.javaCompliance: |
174 if p.javaCompliance > self.javaCompliance: | 174 if p.javaCompliance > self.javaCompliance: |
175 abort("Compliance level doesn't match: Distribution {0} requires {1}, but {2} is {3}.".format(self.name, self.javaCompliance, p.name, p.javaCompliance)) | 175 abort("Compliance level doesn't match: Distribution {0} requires {1}, but {2} is {3}.".format(self.name, self.javaCompliance, p.name, p.javaCompliance)) |
176 | 176 |