Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
20ad5b1
Added support for human readable fixed name of compressed resources -…
Aug 29, 2012
8cca6e6
add media=screen to all compressed tags (until we get a better soluti…
Sep 7, 2012
efdef02
make sure press works with the play pdf module
Sep 7, 2012
0e6034e
Merge branch 'master' of https://github.com/dirkmc/press
Feb 18, 2014
032481d
use play's VirtualFiles to resolve less imports from modules
Feb 18, 2014
3020793
more effective list clone
Feb 18, 2014
b8a9889
version bumped to 1.1
Feb 18, 2014
b174c16
adding build script for jenkins
Feb 18, 2014
0efd152
resolve deps from maven instead of keeping them in lib
Feb 18, 2014
627d6e5
move sources to src so that play will not recompile these classes all…
Feb 18, 2014
3f83990
use newer yuicompressor 2.4.8 that is not available in maven
angryziber Feb 19, 2014
b92896b
bugfix: make sure less imports are actually cached
angryziber Mar 3, 2014
af9e2eb
strip windows CR chars - they seem to break less.js
angryziber Mar 3, 2014
fd9e8c4
releasing 1.2.2 with CR newline fix
angryziber Mar 3, 2014
a99feb2
releases play 1.3 that can use lessc on the command-line instead of t…
angryziber Mar 3, 2014
9d70e52
Play.getVirtualFile() returns null in case file is not found, so we m…
angryziber Mar 6, 2014
eaf80c2
more logical access modifiers
angryziber Mar 6, 2014
5be6d17
log less errors properly
angryziber Mar 6, 2014
865af8e
reuse press' own compressed file storage for less files (e.g. don't s…
angryziber Mar 6, 2014
7c616c1
use virtual files for resolving of import last modified times - other…
angryziber Mar 6, 2014
d150480
do not use virtual file ro resolve tmp location for compressed files,…
angryziber Mar 6, 2014
34e896d
use shorter name for compiled less files
angryziber Mar 6, 2014
cac12f5
release play-press 1.3.1
angryziber Mar 6, 2014
00b70c2
release 1.3.2 without outputting the original filenames and then scan…
angryziber Mar 6, 2014
6f4e6d2
enable conf watching for preprod as well
angryziber Mar 13, 2014
e349c88
support Windows better with cross-platform separator
angryziber Apr 10, 2014
71b648d
bump version
angryziber Apr 10, 2014
382fe5e
release play-press 1.3.4 with media attribute support
Apr 29, 2014
721e97c
Fixed bug: add "media" attribute also in non-compressing mode; added …
andrei-codeborne May 2, 2014
d056bcd
Added test for Plugin.addCss()
andrei-codeborne May 2, 2014
617a397
#{press.single-stylesheet} also supports media attribute; added tests.
andrei-codeborne May 2, 2014
d236cad
use relative path in unit-tests to make them runnable within other pr…
andrei-codeborne May 2, 2014
7eefe24
use relative path in unit-tests to make them runnable within other pr…
andrei-codeborne May 2, 2014
5911abb
fixed unit-test: it should not depend on "Play.mode" that could be se…
andrei-codeborne May 2, 2014
cf34aa7
Fixed IDEA warnings
asolntsev May 3, 2014
7727813
Added test for ScriptCompressor and StyleCompressor
asolntsev May 3, 2014
53feb7f
Release play-press 2.0 that uses Google Closure instead of YUI Compre…
asolntsev May 4, 2014
6c489f1
fixed play-press tests to avoid dependency on test execution order
asolntsev May 4, 2014
dffc79f
updated module exclusions
andrei-codeborne May 5, 2014
84c4ed9
ignore /dist and /tmp folders
asolntsev May 5, 2014
0180c81
Merge remote-tracking branch 'origin/master'
asolntsev May 5, 2014
9fc5170
ignore /dist and /tmp folders
asolntsev May 5, 2014
e9375d1
Log Play roots if less file is not found
May 13, 2014
13d31fe
Added test for LESS compilation with Rhino Javascript engine
May 13, 2014
2b59768
upgrade play-press version to 2.1: better logging of missing files
May 13, 2014
47df643
add support for precompiled less files on production
angryziber May 13, 2014
1b7ae12
release play 2.2 with support for precompiles less files in prod mode
angryziber May 13, 2014
5b69833
make sure PlayLessEngine is not created on every request
angryziber May 13, 2014
c87cb0c
create PleyLessEngine once, not twice
angryziber May 13, 2014
f2260a9
check for precompiled files in dev as well
angryziber May 13, 2014
94a4099
release 2.2.1
angryziber May 13, 2014
a876995
add logs
angryziber May 13, 2014
49aa82b
disable debug logs
angryziber May 13, 2014
d090862
play-press 2.2.4: do not reset play properties
asolntsev Aug 5, 2014
899d5aa
mark press controller with @NoTransaction, so that it will not fail w…
angryziber Sep 22, 2014
e350ce3
Properly close resources in finally block
Oct 7, 2014
01b7f95
get rid of built-in old rhino in yui-compressor (next step - git rid …
angryziber Oct 7, 2014
0b3a45e
Merge branch 'master' of github.com:codeborne/play-press
angryziber Oct 7, 2014
15c3e55
release play press 2.3 with stripped yui-compressor (not including ou…
angryziber Oct 7, 2014
040b087
play-press 2.3.1: remove mockito dependency (it's part of play framew…
asolntsev Jan 13, 2015
bce3d6c
play-press 2.3.1: package jars/yuicompressor-2.4.8.jar (not declared …
asolntsev Jan 13, 2015
e94116a
play-press 2.2.6: remove mockito jar from zip (as it's test dependency)
Jan 14, 2015
c9608c0
Merge remote-tracking branch 'origin/master'
asolntsev Jan 14, 2015
cfce283
play-press 2.2.7: bugfix: it's important close OnDiskCompressedFile b…
Jan 14, 2015
c5aad1d
Merge remote-tracking branch 'origin/master'
asolntsev Jan 14, 2015
ef7012f
support for single-quotes in less @import statements
angryziber Jan 21, 2015
d0fc3fc
play-press 2.2.9: correct usage of slf4j logger
Jan 27, 2015
4b8af6d
fixing reloading of child less files - resolve relative virtual paths…
Feb 3, 2015
ed97f8f
speed up less import resolving
Feb 3, 2015
f120c65
bump version to 2.3 - better reloading of nested less files
Feb 3, 2015
bd46147
use version 2.3.1
Feb 3, 2015
f573c61
bump major version to avoid conflicts with old experimental 2.3 branch
Feb 3, 2015
5808439
drop unused file
angryziber Apr 10, 2015
f4fc007
make node less engine more configurable
angryziber Apr 10, 2015
0d2685d
play press 2.5 with more configurable node less runner
angryziber Apr 10, 2015
2ec9edc
remove dependencies on yuicompressor and clojure compiler - we compre…
angryziber Apr 25, 2015
943d166
drop bundled outdated less 1.3.3, always default to command-line less…
angryziber Apr 25, 2015
95f5216
play tries to resolve tags with .html extension first - renaming so t…
angryziber Apr 27, 2015
3d3e950
do not fail in case of absence of lessc in precompiled mode
angryziber Apr 27, 2015
0d0c116
no need for old newline workaround
angryziber Apr 27, 2015
b9747a7
make sure lessc errors are properly reported
angryziber Apr 27, 2015
6083c1c
bump version to 3.1
angryziber Apr 27, 2015
ba58bb6
Merge branch 'master' of github.com:codeborne/play-press
asolntsev Jul 14, 2015
a4370b4
play-press 3.2: do not clear CSS/JS cache on application restart
andrei-codeborne Jul 14, 2015
ebfb6f9
run tests with every build
andrei-codeborne Jul 14, 2015
51ea8e5
fix failing unit-tests in play-press module
asolntsev Jul 26, 2015
837233c
fix failing unit-tests in play-press module
asolntsev Jul 26, 2015
5152521
do not delete test reports in the end of build
asolntsev Jul 26, 2015
8c06c18
play-press 3.3: log key in case of error
asolntsev Aug 16, 2015
6aeb093
play-press 3.3: code cleanup
asolntsev Aug 16, 2015
58118c3
play-press 3.3: report file name and exit code in case of lessc error
asolntsev Aug 16, 2015
34b2b52
play-press 3.3: do not return "debug" CSS file with error description…
asolntsev Aug 16, 2015
5251354
ignore tmp files
asolntsev Aug 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.DS_Store
*.DS_Store
/lib
/dist
/tmp
42 changes: 21 additions & 21 deletions app/controllers/press/Press.java
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
package controllers.press;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import play.exceptions.UnexpectedException;
import play.mvc.Controller;
import press.CachingStrategy;
import press.PluginConfig;
import press.ScriptCompressedFileManager;
import press.ScriptCompressor;
import press.ScriptRequestHandler;
import press.StyleCompressedFileManager;
import press.StyleCompressor;
import press.StyleRequestHandler;
import play.db.jpa.NoTransaction;
import press.*;
import press.io.CompressedFile;
import press.io.FileIO;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;

@NoTransaction
public class Press extends Controller {
public static final DateTimeFormatter httpDateTimeFormatter = DateTimeFormat
private static final DateTimeFormatter httpDateTimeFormatter = DateTimeFormat
.forPattern("EEE, dd MMM yyyy HH:mm:ss 'GMT'");

private static final Logger logger = LoggerFactory.getLogger(Press.class);

public static void getCompressedJS(String key) {
key = FileIO.unescape(key);
CompressedFile compressedFile = new ScriptCompressedFileManager().getCompressedFile(key);
renderCompressedFile(compressedFile, "JavaScript");
renderCompressedFile(key, compressedFile, "JavaScript");
}

public static void getCompressedCSS(String key) {
key = FileIO.unescape(key);
CompressedFile compressedFile = new StyleCompressedFileManager().getCompressedFile(key);
renderCompressedFile(compressedFile, "CSS");
renderCompressedFile(key, compressedFile, "CSS");
}

private static void renderCompressedFile(CompressedFile compressedFile, String type) {
private static void renderCompressedFile(String key, CompressedFile compressedFile, String type) {
flash.keep();

if (compressedFile == null) {
renderBadResponse(type);
renderBadResponse(key, type);
return;
}

InputStream inputStream = compressedFile.inputStream();
Expand Down Expand Up @@ -71,7 +70,7 @@ private static void renderCompressedFile(CompressedFile compressedFile, String t
// part of the key, so if the file changes, the key in the html file
// will be modified, and the browser will request a new version. Each
// version can therefore be cached indefinitely.
if (PluginConfig.cache.equals(CachingStrategy.Change)) {
if (PluginConfig.cache == CachingStrategy.Change) {
// Cache for a year
response.setHeader("Cache-Control", "max-age=" + 31536000);
response.setHeader("Expires", httpDateTimeFormatter.print(new DateTime().plusYears(1)));
Expand Down Expand Up @@ -101,7 +100,7 @@ public static void clearCSSCache() {
renderText("Cleared " + count + " CSS files from cache");
}

private static void renderBadResponse(String fileType) {
private static void renderBadResponse(String key, String fileType) {
String response = "/*\n";
response += "The compressed " + fileType + " file could not be generated.\n";
response += "This can occur in two situations:\n";
Expand All @@ -113,6 +112,7 @@ private static void renderBadResponse(String fileType) {
response += "2. There was an exception thrown while rendering the ";
response += "page.\n";
response += "*/";
logger.error("Bad response to " + key + " (" + fileType + "): " + response);
renderBinaryResponse(response);
}

Expand Down
1 change: 0 additions & 1 deletion app/play.plugins

This file was deleted.

184 changes: 0 additions & 184 deletions app/press/PlayLessEngine.java

This file was deleted.

9 changes: 0 additions & 9 deletions app/press/PressLogger.java

This file was deleted.

81 changes: 0 additions & 81 deletions app/press/ScriptCompressor.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* See the plugin documentation for more information.
*
}*
${ press.Plugin.compressedJSTag() }
${ press.Plugin.compressedJSTag(_arg).raw() }
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
* See the plugin documentation for more information.
*
}*
${ press.Plugin.compressedCSSTag() }
${ press.Plugin.compressedCSSTag(_arg, _media).raw() }
Loading