Skip to content

Commit

Permalink
prepare release 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Wagner committed Aug 9, 2013
1 parent fb8748e commit ba6388b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Expand Up @@ -4,7 +4,7 @@ name := "scanndal"

version := "0.8"

scalaVersion := "2.9.3"
scalaVersion := "2.10.2"

homepage := Some(url("https://github.com/ouven/scanndal/wiki"))

Expand All @@ -23,7 +23,7 @@ publishTo <<= version { v: String =>

publishMavenStyle := true

scalacOptions += "-deprecation"
scalacOptions ++= Seq("-deprecation", "-feature")

publishArtifact in Test := false

Expand Down
Expand Up @@ -13,24 +13,15 @@ package de.aktey.scanndal.classfile
*/
trait ClassFileInterpretation {

/**
* extend a de.aktey.scanndal.classfile.ClassFile
*/
implicit def extendClassFile(classFile: ClassFile) = new ExtendedClassFile(classFile)

/**
* extend a de.aktey.scanndal.classfile.ConstantPoolEntryUtf8
*/
implicit def extendConstantPoolEntryUtf8(cpe: ConstantPoolEntryUtf8) = new ExtendedConstantPoolEntryUtf8(cpe)

@inline def toCanonicalName(cpUtf8Entry: String) = cpUtf8Entry.replace('/', '.')

@inline def fromCanonicalName(canonicalName: String) = canonicalName.replace('.', '/')

/**
* extend a de.aktey.scanndal.classfile.ClassFile
* @param classFile class file to extend
*/
class ExtendedClassFile(classFile: ClassFile) {
implicit class ExtendedClassFile(classFile: ClassFile) {
/**
* get an index of a class name from the constant pool
*
Expand Down Expand Up @@ -90,9 +81,10 @@ trait ClassFileInterpretation {
}

/**
* extend a de.aktey.scanndal.classfile.ConstantPoolEntryUtf8
* @param constantPoolEntry utf8 pool entry to extend
*/
class ExtendedConstantPoolEntryUtf8(constantPoolEntry: ConstantPoolEntryUtf8) {
implicit class ExtendedConstantPoolEntryUtf8(constantPoolEntry: ConstantPoolEntryUtf8) {
/**
* @return represented String utf-8 decoded
*/
Expand Down
@@ -1,6 +1,7 @@
package de.aktey.scanndal.classfile.filter

import de.aktey.scanndal.classfile.{ClassFileInterpretation, RuntimeVisibleAnnotationsAttribute, ClassFile}
import scala.reflect._

/**
* Created with IntelliJ IDEA.
Expand All @@ -13,8 +14,8 @@ import de.aktey.scanndal.classfile.{ClassFileInterpretation, RuntimeVisibleAnnot
* test class files for a class annotation A
* @tparam A the annotation class
*/
class ClassAnnotationFilter[A: Manifest] extends Filter with ClassFileInterpretation {
val annotationTypeDescriptor = "L" + fromCanonicalName(manifest[A].erasure.getCanonicalName) + ";"
class ClassAnnotationFilter[A: ClassTag] extends Filter with ClassFileInterpretation {
val annotationTypeDescriptor = "L" + fromCanonicalName(classTag[A].runtimeClass.getCanonicalName) + ";"

/**
* @param cf classfile to test
Expand Down
@@ -1,15 +1,16 @@
package de.aktey.scanndal.classfile.filter

import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile}
import scala.reflect._

/**
* Created with IntelliJ IDEA.
* User: ruben
* Date: 09.08.13
* Time: 23:33
*/
class InterfaceFilter[T: Manifest] extends Filter with ClassFileInterpretation {
val interfaceName = fromCanonicalName(manifest[T].erasure.getCanonicalName)
class InterfaceFilter[T: ClassTag] extends Filter with ClassFileInterpretation {
val interfaceName = fromCanonicalName(classTag[T].runtimeClass.getCanonicalName)

def apply(classFile: ClassFile) = classFile
.interfaces.toStream
Expand Down
@@ -1,6 +1,7 @@
package de.aktey.scanndal.classfile.filter

import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile}
import scala.reflect._

/**
* Created with IntelliJ IDEA.
Expand All @@ -10,8 +11,8 @@ import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile}
*
* filters for all classes with the direct super type S
*/
class SuperClassFilter[S: Manifest] extends Filter with ClassFileInterpretation {
val superTypeInfo = fromCanonicalName(manifest[S].erasure.getCanonicalName)
class SuperClassFilter[S: ClassTag] extends Filter with ClassFileInterpretation {
val superTypeInfo = fromCanonicalName(classTag[S].runtimeClass.getCanonicalName)

def apply(cf: ClassFile) = cf.superClassName == superTypeInfo
}

0 comments on commit ba6388b

Please sign in to comment.