Skip to content

Commit

Permalink
Bumped version to 0.6.
Browse files Browse the repository at this point in the history
Fixed Migrations trait
Added seed file to migrations.
  • Loading branch information
luismfonseca committed Jun 6, 2014
1 parent 40c7450 commit c58edaf
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In most cases, a global installation will make the most sense. This is strongly

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:

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

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:

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ organization := "pt.pimentelfonseca"

profileName := "pt.pimentelfonseca"

version := "0.5"
version := "0.6"

//scalaVersion := "2.11.0"
//libraryDependencies ++= Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package PACKAGE_DB.migrations

import PACKAGE_DB._
import PACKAGE_DB.tables._
import PACKAGE_NAME._

import java.util.Date

import scala.slick.driver.MySQLDriver.simple._

class Seed extends Migration {

override def version = "00:00:00 01/01/2001"

override def up =
{
App.DB withSession {
implicit session =>
}
}

override def down = ???
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait Migration {

def version: Long = ???

def up() = ???
def up()

def down() = ???
def down()
}
2 changes: 1 addition & 1 deletion src/main/scala/Android.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected object Android
{
val manifestFile = findManifestPath(sourceDirectory)

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

pemissionsXML.map(_.attribute("http://schemas.android.com/apk/res/android", "name").getOrElse(new Text("")).head.text)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/Create.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Create
def templateKeys(sbtVersion: String, pluginVersion: String, packageName: String, minSdkVersion: Int) = {
ListMap[String, String](
"SBT_VERSION" -> sbtVersion,
"PLUGIN_VERSION" -> "0.5",
"PLUGIN_VERSION" -> "0.6",
"PACKAGE_NAME_AS_DIR" -> packageName.replace('.', '/'),
"PACKAGE_NAME" -> packageName,
"PACKAGE_MODELS" -> (packageName + ".models"),
Expand Down
11 changes: 10 additions & 1 deletion src/main/scala/Permissions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ object Permissions

val intentPermissions = mappedIntentPermissions(16)

sourceFilesNoComments.foldLeft(Array[String]())
val intentPermissionsFound = sourceFilesNoComments.foldLeft(Array[String]())
{
(neededPermissions, fileContent) =>
{
Expand All @@ -146,6 +146,15 @@ object Permissions
}
}
}

if (sourceFilesNoComments.exists(_.contains("http://"))) // could also yield false-positives
{
intentPermissionsFound :+ "android.permission.INTERNET"
}
else
{
intentPermissionsFound
}
}

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

0 comments on commit c58edaf

Please sign in to comment.