use resolved dependency version for mapping files
parent
529db72b25
commit
fe194ea64d
|
@ -55,9 +55,9 @@ public class MappingsProvider extends DependencyProvider {
|
||||||
public void provide(DependencyInfo dependency, Project project, LoomGradleExtension extension) throws Exception {
|
public void provide(DependencyInfo dependency, Project project, LoomGradleExtension extension) throws Exception {
|
||||||
MinecraftProvider minecraftProvider = getDependencyManager().getProvider(MinecraftProvider.class);
|
MinecraftProvider minecraftProvider = getDependencyManager().getProvider(MinecraftProvider.class);
|
||||||
|
|
||||||
project.getLogger().lifecycle(":setting up mappings (" + dependency.getDependency().getName() + " " + dependency.getDependency().getVersion() + ")");
|
project.getLogger().lifecycle(":setting up mappings (" + dependency.getDependency().getName() + " " + dependency.getResolvedVersion() + ")");
|
||||||
|
|
||||||
String version = dependency.getDependency().getVersion();
|
String version = dependency.getResolvedVersion();
|
||||||
String[] split = version.split("\\.");
|
String[] split = version.split("\\.");
|
||||||
|
|
||||||
File mappingsJar = dependency.resolveFile();
|
File mappingsJar = dependency.resolveFile();
|
||||||
|
|
|
@ -28,6 +28,7 @@ import net.fabricmc.loom.LoomGradleExtension;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
import org.gradle.api.artifacts.Configuration;
|
import org.gradle.api.artifacts.Configuration;
|
||||||
import org.gradle.api.artifacts.Dependency;
|
import org.gradle.api.artifacts.Dependency;
|
||||||
|
import org.gradle.api.artifacts.ResolvedDependency;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -72,6 +73,16 @@ public abstract class DependencyProvider {
|
||||||
return dependency;
|
return dependency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getResolvedVersion() {
|
||||||
|
for (ResolvedDependency rd : sourceConfiguration.getResolvedConfiguration().getFirstLevelModuleDependencies()) {
|
||||||
|
if (rd.getModuleGroup().equals(dependency.getGroup()) && rd.getModuleName().equals(dependency.getName())) {
|
||||||
|
return rd.getModuleVersion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dependency.getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
public Configuration getSourceConfiguration() {
|
public Configuration getSourceConfiguration() {
|
||||||
return sourceConfiguration;
|
return sourceConfiguration;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue