Skip to content

Commit c58edaf

Browse files
committed
Bumped version to 0.6.
Fixed Migrations trait Added seed file to migrations.
1 parent 40c7450 commit c58edaf

File tree

7 files changed

+39
-7
lines changed

7 files changed

+39
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In most cases, a global installation will make the most sense. This is strongly
1111

1212
If you don't already have one, create an `~/.sbt/0.13/plugins` directory. And inside of it, create an `agile-scala-android.sbt` (it doesn't matter what you call it) file containing the line:
1313

14-
addSbtPlugin("pt.pimentelfonseca" % "agile-scala-android" % "0.5")
14+
addSbtPlugin("pt.pimentelfonseca" % "agile-scala-android" % "0.6")
1515

1616
Next, you can add the settings `agileAndroidNewProjectTask` globally, which will add just a single task: `npa`. To do this, create a file under `~/.sbt/0.13` called `npa.sbt` (it doesn't matter what you call this either) containing the line:
1717

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ organization := "pt.pimentelfonseca"
1414

1515
profileName := "pt.pimentelfonseca"
1616

17-
version := "0.5"
17+
version := "0.6"
1818

1919
//scalaVersion := "2.11.0"
2020
//libraryDependencies ++= Seq(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package PACKAGE_DB.migrations
2+
3+
import PACKAGE_DB._
4+
import PACKAGE_DB.tables._
5+
import PACKAGE_NAME._
6+
7+
import java.util.Date
8+
9+
import scala.slick.driver.MySQLDriver.simple._
10+
11+
class Seed extends Migration {
12+
13+
override def version = "00:00:00 01/01/2001"
14+
15+
override def up =
16+
{
17+
App.DB withSession {
18+
implicit session =>
19+
}
20+
}
21+
22+
override def down = ???
23+
}

src/main/resources/database/scala/PACKAGE_NAME_AS_DIR/db/Migration.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait Migration {
1010

1111
def version: Long = ???
1212

13-
def up() = ???
13+
def up()
1414

15-
def down() = ???
15+
def down()
1616
}

src/main/scala/Android.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected object Android
4848
{
4949
val manifestFile = findManifestPath(sourceDirectory)
5050

51-
val pemissionsXML = XML.loadFile(manifestFile).child.filter(_.label == "permission")
51+
val pemissionsXML = XML.loadFile(manifestFile).child.filter(_.label == "uses-permission")
5252

5353
pemissionsXML.map(_.attribute("http://schemas.android.com/apk/res/android", "name").getOrElse(new Text("")).head.text)
5454
}

src/main/scala/Create.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Create
1010
def templateKeys(sbtVersion: String, pluginVersion: String, packageName: String, minSdkVersion: Int) = {
1111
ListMap[String, String](
1212
"SBT_VERSION" -> sbtVersion,
13-
"PLUGIN_VERSION" -> "0.5",
13+
"PLUGIN_VERSION" -> "0.6",
1414
"PACKAGE_NAME_AS_DIR" -> packageName.replace('.', '/'),
1515
"PACKAGE_NAME" -> packageName,
1616
"PACKAGE_MODELS" -> (packageName + ".models"),

src/main/scala/Permissions.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ object Permissions
122122

123123
val intentPermissions = mappedIntentPermissions(16)
124124

125-
sourceFilesNoComments.foldLeft(Array[String]())
125+
val intentPermissionsFound = sourceFilesNoComments.foldLeft(Array[String]())
126126
{
127127
(neededPermissions, fileContent) =>
128128
{
@@ -146,6 +146,15 @@ object Permissions
146146
}
147147
}
148148
}
149+
150+
if (sourceFilesNoComments.exists(_.contains("http://"))) // could also yield false-positives
151+
{
152+
intentPermissionsFound :+ "android.permission.INTERNET"
153+
}
154+
else
155+
{
156+
intentPermissionsFound
157+
}
149158
}
150159

151160
def analyseNeededPermissions(sourceFiles: Seq[File], temporaryDirectory: File, jarPath: String): Array[String] =

0 commit comments

Comments
 (0)