File tree Expand file tree Collapse file tree
plugins/2013.2090/android
src/main/java/plugin/pasteboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,4 +42,29 @@ task exportPluginJar() {
4242 }
4343}
4444
45+ task deployPluginToDirectory () {
46+ group " Corona-dev"
47+ dependsOn assemble
48+ doLast {
49+ copy {
50+ from {
51+ zipTree(" $buildDir /outputs/aar/${ project.name} -release.aar" ). matching {
52+ include ' classes.jar'
53+ }. singleFile
54+ }
55+ into " $buildDir /outputs/../../../../../plugins/2013.2090/android/"
56+
57+ File pluginManifestFile = file(" src/main/AndroidManifest.xml" )
58+ if (pluginManifestFile. exists()) {
59+ String manifestContents = pluginManifestFile. text
60+ def pluginManifestXml = new XmlSlurper (). parseText(manifestContents)
61+ String packageName = pluginManifestXml. @package. toString()
62+ rename " classes.jar" , " ${ packageName} .jar"
63+ } else {
64+ rename " classes.jar" , " plugin.jar"
65+ }
66+ }
67+ }
68+ }
69+
4570assemble. finalizedBy(exportPluginJar)
Original file line number Diff line number Diff line change @@ -40,18 +40,19 @@ public void addClipChangedListener() {
4040 final Context context = CoronaEnvironment .getApplicationContext ();
4141 if (context == null ) return ;
4242
43- if (clipboardManager == null ) {
44- clipboardManager = (android .content .ClipboardManager ) context .getSystemService (Context .CLIPBOARD_SERVICE );
45- }
46- if (clipboardManager == null ) return ;
47-
4843 // Verify environment
4944 CoronaActivity coronaActivity = CoronaEnvironment .getCoronaActivity ();
5045 if (coronaActivity == null ) return ;
5146
5247 coronaActivity .runOnUiThread (new Runnable () {
5348 public void run () {
5449
50+ if (clipboardManager == null ) {
51+ clipboardManager = (android .content .ClipboardManager ) context .getSystemService (Context .CLIPBOARD_SERVICE );
52+ }
53+ if (clipboardManager == null ) return ;
54+
55+
5556 if (primaryClipChangedListener == null ) {
5657 primaryClipChangedListener = new android .content .ClipboardManager .OnPrimaryClipChangedListener () {
5758 public void onPrimaryClipChanged () {
@@ -60,7 +61,6 @@ public void onPrimaryClipChanged() {
6061 };
6162 }
6263
63-
6464 // Grab the initial clipboard contents and put them in pasteboard, if any.
6565 setNewPasteboardItem (context );
6666 clipboardManager .addPrimaryClipChangedListener (primaryClipChangedListener );
You can’t perform that action at this time.
0 commit comments