This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def void explainMe(it) { | |
println "Examining $it.name:" | |
println "Meta:" | |
println it.metaClass.metaMethods*.name.sort().unique() | |
println "Methods:" | |
println it.metaClass.methods*.name.sort().unique() | |
println "Properties:" | |
println it.properties.entrySet()*.toString() | |
.sort().toString().replaceAll(", ","\n") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static groovy.io.FileType.FILES | |
// This task discovers the manifest files for the .aars that we depend on and | |
// adds them to project.ext.manifestFiles for use in later tasks. | |
task discoverManifestFiles(dependsOn: 'prepareDebugDependencies') << { | |
def aars = new File(project.buildDir.absolutePath + "/intermediates/exploded-aar") | |
def manifestFiles = new ArrayList<File>() | |
// Iterate through the exploded-aars directory, finding the manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Workaround for missing test resources when run unit tests within android studio. | |
// This copy the test resources next to the test classes for each variant. | |
// Tracked at https://github.com/nenick/AndroidStudioAndRobolectric/issues/7 | |
// Original solution comes from https://code.google.com/p/android/issues/detail?id=136013#c10 | |
gradle.projectsEvaluated { | |
// Base path which is recognized by android studio. | |
def testClassesPath = "${buildDir}/intermediates/classes/test/" | |
// Copy must be done for each variant. | |
def variants = android.applicationVariants.collect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomRobolectricTestRunner extends RobolectricGradleTestRunner { | |
private static final int MAX_SDK_LEVEL = 21; | |
public CustomRobolectricTestRunner(Class<?> testClass) throws InitializationError { | |
super(testClass); | |
} | |
@Override | |
public Config getConfig(Method method) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCurrentGitBranch() { | |
def gitBranch = "Unknown branch" | |
try { | |
def workingDir = new File("${project.projectDir}") | |
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir) | |
result.waitFor() | |
if (result.exitValue() == 0) { | |
gitBranch = result.text.trim() | |
} | |
} catch (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCurrentGitCommitHash() { | |
def gitCommit = "Unknown commit" | |
try { | |
def workingDir = new File("${project.projectDir}") | |
def result = 'git rev-parse --short HEAD'.execute(null, workingDir) | |
result.waitFor() | |
if (result.exitValue() == 0) { | |
gitCommit = result.text.trim() | |
} | |
} catch (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unity project files | |
/[Ll]ibrary/ | |
/[Tt]emp/ | |
/[Oo]bj/ | |
/[Bb]uild/ | |
*.unityproj | |
# Autogenerated VS/MD solution and project files | |
ExportedObj/ | |
*.csproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace YourNamespace { | |
/// <summary> | |
/// Put a description of the class here. | |
/// </summary> | |
public class YourClass { | |
/// <summary> | |
/// Put a description of the method here. | |
/// </summary> | |
/// <param name="key">Put a description of the parameter here.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace YourNamespace.UnitTests { | |
using UnityEngine; | |
using NUnit.Framework; | |
public class YourClassTest { | |
private YourClass yourClass; | |
[SetUp] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
BASE_URL=http://netstorage.unity3d.com/unity | |
HASH=649f48bbbf0f | |
VERSION=5.4.1f1 | |
download() { | |
url="$BASE_URL/$HASH/$package" | |
echo "Downloading from $url: " |
OlderNewer