Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
tsts="$TM_SELECTED_TEXT"
if [ -z "$TM_SELECTED_TEXT" ]
then
#echo `cat $TM_FILEPATH | grep -Po "(?<=defaultTasks\s\")(.*)(?=\")"`
deftasks=`cat $TM_FILEPATH | grep -Po "(?<=defaultTasks\s\")(.*)(?=\")"`
# if deftask is null open dialog to ask for tasks to execute
if [ -z "$deftasks" ]
then
res=$("$TM_SUPPORT_PATH/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog" inputbox --title "I Need Input" \
@breskeby
breskeby / multipleTestExecution
Created February 20, 2011 21:16
run the same test multiple times with gradle
class LoadTest extends Test{
private numberOfClients = 2
public LoadTest(){
super()
}
public FileTree getCandidateClassFiles() {
FileTree candidateTimes = super.getCandidateClassFiles()
for(int client = 1; client<numberOfClients;client++){
candidateTimes = candidateTimes + super.getCandidateClassFiles()
private final String attrName = "name"
private String name;
...
...
logger.debug(attrName + " is " + name);
@breskeby
breskeby / build.gradle
Created June 13, 2011 00:24
Incremental test task execution on jenkins
apply plugin:'groovy'
repositories{
mavenCentral()
}
dependencies{
groovy "org.codehaus.groovy:groovy-all:1.7.10"
testCompile "junit:junit:4.8.2"
}
@breskeby
breskeby / sonartype-snapshot
Created February 3, 2012 08:26
Sample Buildfile to resolve deps from sonartype snapshot repository
apply plugin:'java'
repositories{
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies{
compile "org.ajoberstar:gradle-git:0.1.1-SNAPSHOT"
@breskeby
breskeby / .gitconfig
Created December 5, 2012 08:43
Gradle alias for Git
[alias]
test = !gradle test
@breskeby
breskeby / gist:5626231
Created May 22, 2013 09:03
directory with js files
task printJSFiles << {
def jsFiles = fileTree(dir:"dir1", include:'*.js')
println jsFiles.files
}
#!/bin/bash
FOUND=0
CURR_PATH="$PWD"
REAL_GRADLEW="$CURR_PATH/gradlew"
REAL_MASTER_GRADLEW="$CURR_PATH/master/gradlew"
# Check current directory, which might be root directory for gradlew
if [ -x "$REAL_GRADLEW" ]; then
FOUND=1
@breskeby
breskeby / gist:7858657
Last active August 3, 2018 23:37
dos2unix on some text files with gradle
task convertFiles <<{
fileTree("someFolder").matching{ include "**/*.txt"}.each{ aFile ->
exec{
commandLine 'dos2unix'
args aFile.absolutePath
}
}
}
@breskeby
breskeby / build.gradle
Created April 25, 2014 08:33
log java compiler warnings with gradle
tasks.withType(JavaCompile){
def warnLogFile = file("$buildDir/${name}Warnings.log")
logging.addStandardErrorListener(new StandardOutputListener(){
void onOutput(CharSequence output){
warnLogFile << output
}
})
}