Skip to content

Instantly share code, notes, and snippets.

def manifestVersionName() {
def manifestFile = file(project.projectDir.absolutePath + '/AndroidManifest.xml')
def ns = new groovy.xml.Namespace("http://schemas.android.com/apk/res/android", "android")
def xml = new XmlParser().parse(manifestFile)
return xml.attributes()[ns.versionName].toString()
}
def manifestVersionCode() {
def manifestFile = file(project.projectDir.absolutePath + '/AndroidManifest.xml')
def ns = new groovy.xml.Namespace("http://schemas.android.com/apk/res/android", "android")
@beartung
beartung / gradle-detect-sdk-buildtools
Last active November 4, 2017 03:03
detect highest android sdk with gradle
//from http://www.egeek.me/2013/12/07/gradle-auto-detect-android-sdk-and-build-tools-versions/
import org.codehaus.groovy.runtime.StackTraceUtils
String androidSDKDir() {
def androidExecPath = new ByteArrayOutputStream()
try {
exec {
commandLine 'which', 'android'
standardOutput = androidExecPath
}
svn dev style like this
--
you:
svn cp /trunk /branches/xxx
svn co /branches/xxx
ooxx... ooxx..
svn ci -m "ooxx"
sb:
cd trunk
DBPageViewController * pc = [self getPageController:a.toPageId];
pc.refer = pid;
[self addChildViewController:pc];
[self.view addSubview:pc.view];
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height;
pc.view.frame = CGRectMake(width, 0, width, height);
DBPageViewController * pfc = [self getPageController:a.fromPageId];