diff options
author | LexManos <LexManos@gmail.com> | 2021-01-17 21:08:21 -0800 |
---|---|---|
committer | LexManos <LexManos@gmail.com> | 2021-01-17 21:08:21 -0800 |
commit | 4b39e3af8d3c0fe9f0ae03391715ff586bccf56d (patch) | |
tree | 6e17f665e5c0c8e5f6b5668eaccf97f2c6aeb71c | |
parent | 28190035b0b547968a6f430200957dda8a0b846e (diff) | |
download | Artifactural-4b39e3af8d3c0fe9f0ae03391715ff586bccf56d.tar.gz Artifactural-4b39e3af8d3c0fe9f0ae03391715ff586bccf56d.tar.bz2 Artifactural-4b39e3af8d3c0fe9f0ae03391715ff586bccf56d.zip |
Allow missing metadata
-rw-r--r-- | build.gradle | 13 | ||||
-rw-r--r-- | src/gradlecomp/java/net/minecraftforge/artifactural/gradle/GradleRepositoryAdapter.java | 6 |
2 files changed, 8 insertions, 11 deletions
diff --git a/build.gradle b/build.gradle index 10b9def..a1aa9e9 100644 --- a/build.gradle +++ b/build.gradle @@ -7,16 +7,9 @@ plugins { } group = 'net.minecraftforge' -version = gitVersion() - -def gitVersion() { - def raw = grgit.describe(longDescr: true, tags: true) - def desc = (raw == null ? 'unknown-unknown-unknown' : raw).split('-') as List - def hash = desc.remove(desc.size() - 1) - def offset = desc.remove(desc.size() - 1) - def tag = desc.join('-') - return "${tag}.${offset}" -} + +version = (grgit.describe(longDescr: true, tags: true) ?: 'unknown-unknown-unknown').split('-').with { "${it[0]}.${it[1]}" } +println('Version: ' + version + ' Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) sourceSets { api diff --git a/src/gradlecomp/java/net/minecraftforge/artifactural/gradle/GradleRepositoryAdapter.java b/src/gradlecomp/java/net/minecraftforge/artifactural/gradle/GradleRepositoryAdapter.java index 87cd246..0970397 100644 --- a/src/gradlecomp/java/net/minecraftforge/artifactural/gradle/GradleRepositoryAdapter.java +++ b/src/gradlecomp/java/net/minecraftforge/artifactural/gradle/GradleRepositoryAdapter.java @@ -91,6 +91,10 @@ public class GradleRepositoryAdapter extends AbstractArtifactRepository implemen DefaultMavenLocalArtifactRepository maven = (DefaultMavenLocalArtifactRepository)factory.createMavenLocalRepository(); // We use maven local because it bypasses the caching and coping to .m2 maven.setUrl(local); maven.setName(name); + maven.metadataSources(m -> { + m.mavenPom(); + m.artifact(); + }); GradleRepositoryAdapter repo; @@ -139,7 +143,7 @@ public class GradleRepositoryAdapter extends AbstractArtifactRepository implemen public ConfiguredModuleComponentRepository createResolver() { MavenResolver resolver = (MavenResolver)local.createResolver(); - GeneratingFileResourceRepository repo = new GeneratingFileResourceRepository(); + GeneratingFileResourceRepository repo = new GeneratingFileResourceRepository(); ReflectionUtils.alter(resolver, "repository", prev -> repo); // ExternalResourceResolver.repository //ReflectionUtils.alter(resolver, "metadataSources", ); //ExternalResourceResolver.metadataSources We need to fix these from returning 'missing' // MavenResolver -> MavenMetadataLoader -> FileCacheAwareExternalResourceAccessor -> DefaultCacheAwareExternalResourceAccessor |