Wrap all remaining uses of Grgit

This allows you to build from a zip folder of CC:T. Fixes #307. Also fix
the build, woops.
This commit is contained in:
SquidDev 2019-10-30 17:07:29 +00:00
parent c311cdc6f5
commit 38f9a015ca
4 changed files with 10 additions and 4 deletions

View File

@ -331,6 +331,7 @@ task compressJson(dependsOn: extractAnnotationsJar) {
if (!ok) throw new IllegalStateException("Could not check release") if (!ok) throw new IllegalStateException("Could not check release")
} }
} }
check.dependsOn checkRelease
curseforge { curseforge {
apiKey = project.hasProperty('curseForgeApiKey') ? project.curseForgeApiKey : '' apiKey = project.hasProperty('curseForgeApiKey') ? project.curseForgeApiKey : ''
@ -402,7 +403,9 @@ task compressJson(dependsOn: extractAnnotationsJar) {
token project.hasProperty('githubApiKey') ? project.githubApiKey : '' token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
owner 'SquidDev-CC' owner 'SquidDev-CC'
repo 'CC-Tweaked' repo 'CC-Tweaked'
targetCommitish { Grgit.open(dir: '.').branch.current().name } try {
targetCommitish = Grgit.open(dir: '.').branch.current().name
} catch(Exception ignored) { }
tagName "v${mc_version}-${mod_version}" tagName "v${mc_version}-${mod_version}"
releaseName "[${mc_version}] ${mod_version}" releaseName "[${mc_version}] ${mod_version}"

View File

@ -23,7 +23,7 @@
import java.net.URL; import java.net.URL;
/** /**
* A very basic environment * A very basic environment.
*/ */
public class BasicEnvironment implements IComputerEnvironment public class BasicEnvironment implements IComputerEnvironment
{ {
@ -93,7 +93,6 @@ public InputStream createResourceFile( String domain, String subPath )
return ComputerCraft.class.getClassLoader().getResourceAsStream( "assets/" + domain + "/" + subPath ); return ComputerCraft.class.getClassLoader().getResourceAsStream( "assets/" + domain + "/" + subPath );
} }
public static IMount createMount( Class<?> klass, String path, String fallback ) public static IMount createMount( Class<?> klass, String path, String fallback )
{ {
File file = getContainingFile( klass ); File file = getContainingFile( klass );

View File

@ -26,6 +26,10 @@ public class FileSystemTest
/** /**
* Ensures writing a file truncates it. * Ensures writing a file truncates it.
*
* @throws FileSystemException When the file system cannot be constructed.
* @throws LuaException When Lua functions fail.
* @throws IOException When reading and writing from strings
*/ */
@Test @Test
public void testWriteTruncates() throws FileSystemException, LuaException, IOException public void testWriteTruncates() throws FileSystemException, LuaException, IOException

View File

@ -13,7 +13,7 @@
import java.util.*; import java.util.*;
/** /**
* Mounts in memory * In-memory file mounts.
*/ */
public class MemoryMount implements IWritableMount public class MemoryMount implements IWritableMount
{ {