Skip to content

Commit

Permalink
Merge pull request #246 from godenji/0.2.2
Browse files Browse the repository at this point in the history
0.2.2 release
  • Loading branch information
godenji committed Jul 19, 2017
2 parents 6eb5041 + d3d4ca8 commit 9cdd77d
Show file tree
Hide file tree
Showing 23 changed files with 352 additions and 36 deletions.
15 changes: 2 additions & 13 deletions .gitignore
@@ -1,24 +1,13 @@
target/
!scalariform.update/target/
lib_managed/
src_managed/
project/boot/
bin/
.scala_dependencies
core/target/
core/lib_managed/
core/src_managed/
gui/target/
gui/lib_managed/
gui/src_managed/
corpusscan/target/
corpusscan/lib_managed/
corpusscan/src_managed/
docs/build
nohup.out
.history
.cache
.idea/
.settings
.classpath
.project
.cache*
*~
6 changes: 6 additions & 0 deletions CHANGELOG
@@ -1,3 +1,9 @@
0.2.2 (19/July/17)

* Added IDE friendly preference descriptors
* Added Maven components for generating Eclipse update site
* Uploaded generated Eclipse update site

0.2.1 (14/July/17)

* FIX: Revert removal of DoubleIndentClassDeclaration which was erroneously marked as having been deprecated since scalariform 0.1.5 (in reality the deprecation occurred in 0.2.0-snapshot)
Expand Down
15 changes: 11 additions & 4 deletions README.rst
Expand Up @@ -52,7 +52,7 @@ Usage within a project

Have a use for the scalariform source code directly? You can use it as a build dependency: ::

"org.scalariform" %% "scalariform" % "0.2.1"
"org.scalariform" %% "scalariform" % "0.2.2"

Integration with Eclipse
------------------------
Expand All @@ -71,6 +71,11 @@ To set preferences, go to either
- Window -> Preferences -> Scala -> Editor -> Formatter
- Project -> Properties -> Scala Formatter

From the formatter preference window you can import/export existing preferences.
See the `reference.conf`_ for a listing of all available preferences and their defaults.

.. _reference.conf: https://github.com/scala-ide/scalariform/blob/master/formatterPreferences.properties

Integration with Emacs/ENSIME
-----------------------------

Expand Down Expand Up @@ -132,7 +137,7 @@ Usage (Gradle 2.1 and above)::
alignParameters = true
alignSingleLineCaseStatements = true
}

formatAllScala

See `the documentation`_ for further usage examples.
Expand All @@ -159,7 +164,9 @@ the following to ``.vimrc`` ::
au BufEnter *.scala setl equalprg=java\ -jar\ /home/me/bin/scalariform.jar\ -f\ -q\ +compactControlReadability\ +alignParameters\ +alignSingleLineCaseStatements\ +doubleIndentConstructorArguments\ +rewriteArrowSymbols\ +preserveSpaceBeforeArguments\ --stdin\ --stdout


You can create your own executable scalariform.jar by following the instructions at the top of this file, in "Packaging an executable JAR."
Download scalariform.jar from the `latest release`_

.. _latest release: https://github.com/scala-ide/scalariform/releases/latest

Command line tool
-----------------
Expand Down Expand Up @@ -396,7 +403,7 @@ becomes:
If ``Preserve``, scalariform will try to match what unformatted source code is already doing per parenthesis,
either forcing or preventing.

doubleIndentClassDeclaration
~~doubleIndentClassDeclaration~~ (Deprecated, use `doubleIndentConstructorArguments`)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Default: ``false``
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/scala/scalariform/Utils.scala
Expand Up @@ -2,7 +2,7 @@ package scalariform

object Utils {
def writeText(file: java.io.File, text: String, encodingOpt: Option[String] = None) {
import java.io.{ OutputStreamWriter, FileOutputStream }
import java.io.{OutputStreamWriter, FileOutputStream}
val encoding = encodingOpt getOrElse (System getProperty "file.encoding")
val writer = new OutputStreamWriter(new FileOutputStream(file), encoding)
try
Expand Down
@@ -1,7 +1,7 @@
package scalariform.commandline

import java.io.File
import java.util.{ ArrayList, Collection }
import java.util.{ArrayList, Collection}
import scala.collection.JavaConverters._

import org.apache.commons.io._
Expand Down
182 changes: 182 additions & 0 deletions pom.xml
@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.scalariform</groupId>
<artifactId>scalariform.parent</artifactId>
<version>0.2.2</version>
<packaging>pom</packaging>

<!-- scm configuration is require to extract the github hash-->
<scm>
<connection>scm:git://github.com/scala-ide/scalariform.git</connection>
<url>https://github.com/scala-ide/scalariform</url>
</scm>

<properties>
<encoding>UTF-8</encoding>
<tycho.version>0.24.0</tycho.version>
<scala.version>2.12.2</scala.version>
<scala.xml.version>1.0.6</scala.xml.version>
<scala.parser-combinators.version>1.0.6</scala.parser-combinators.version>
<scala.version.suffix>2_12</scala.version.suffix>
</properties>

<modules>
<module>scalariform</module>
<module>scalariform.feature</module>
<module>scalariform.update</module>
</modules>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-versions-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
<!-- git hash extractor -->
<plugin>
<!-- plugin used to extract the git hash and store it in ${buildNumber} -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>7</shortRevisionLength>
</configuration>
</plugin>
<!-- for setting a better qualifier -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<format>'${scala.version.suffix}-'yyyyMMddHHmm'-${buildNumber}'</format>
<archiveSite>true</archiveSite>
</configuration>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-Xss4m</jvmArg>
</jvmArgs>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>neon</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/neon</url>
</repository>
<repository>
<id>sonatype.release</id>
<name>Sonatype maven release repository</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>sonatype.snapshot</id>
<name>Sonatype maven snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
<profiles>
<profile>
<id>scala-2.10.x</id>
<properties>
<scala.version>2.10.6</scala.version>
</properties>
</profile>
<profile>
<id>scala-2.11.x</id>
<properties>
<scala.version>2.11.11</scala.version>
<version.suffix>2.11</version.suffix>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_${version.suffix}</artifactId>
<version>${scala.xml.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_${version.suffix}</artifactId>
<version>${scala.parser-combinators.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>scala-2.12.x</id>
<properties>
<scala.version>2.12.2</scala.version>
<version.suffix>2.12</version.suffix>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_${version.suffix}</artifactId>
<version>${scala.xml.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_${version.suffix}</artifactId>
<version>${scala.parser-combinators.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
1 change: 0 additions & 1 deletion project/project/plugins.sbt

This file was deleted.

1 change: 1 addition & 0 deletions scalariform.feature/build.properties
@@ -0,0 +1 @@
bin.includes = feature.xml
55 changes: 55 additions & 0 deletions scalariform.feature/feature.xml
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="scalariform.feature"
label="Scalariform"
version="0.2.2">

<description>
Scala Code formatter
</description>

<license>
The MIT License

Copyright (c) 2010 Matthew D. Russell

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
&quot;Software&quot;), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</license>

<requires>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.jdt.ui"/>
<import plugin="org.eclipse.jface.text"/>
<import plugin="org.eclipse.text"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="org.eclipse.ui.views"/>
</requires>

<plugin
id="scalariform"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
13 changes: 13 additions & 0 deletions scalariform.feature/pom.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>scalariform.feature</artifactId>
<packaging>eclipse-feature</packaging>
<parent>
<artifactId>scalariform.parent</artifactId>
<groupId>org.scalariform</groupId>
<version>0.2.2</version>
</parent>
</project>
13 changes: 13 additions & 0 deletions scalariform.update/pom.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>scalariform.update</artifactId>
<packaging>eclipse-update-site</packaging>
<parent>
<artifactId>scalariform.parent</artifactId>
<groupId>org.scalariform</groupId>
<version>0.2.2</version>
</parent>
</project>
11 changes: 11 additions & 0 deletions scalariform.update/site.xml
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description name="Scalariform Update Site"
url="https://github.com/scala-ide/scalariform/tree/0.2.2/scalariform.update/target/site">
Scalariform Update Site
</description>
<feature url="features/scalariform.feature_0.2.2.jar" version="0.2.2" id="scalariform.feature">
<category name="Scala"/>
</feature>
<category-def name="Scala" label="Scala"/>
</site>
Binary file added scalariform.update/target/site.zip
Binary file not shown.
Binary file added scalariform.update/target/site/artifacts.jar
Binary file not shown.
Binary file added scalariform.update/target/site/content.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions scalariform.update/target/site/site.xml
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description name="Scalariform Update Site"
url="https://github.com/scala-ide/scalariform/tree/0.2.2/scalariform.update/target/site">
Scalariform Update Site
</description>
<feature url="features/scalariform.feature_0.2.2.jar" version="0.2.2" id="scalariform.feature">
<category name="Scala"/>
</feature>
<category-def name="Scala" label="Scala"/>
</site>
Binary file added scalariform.update/target/site_assembly.zip
Binary file not shown.

0 comments on commit 9cdd77d

Please sign in to comment.