• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / smartsprites / #43

11 Nov 2023 07:47PM UTC coverage: 88.431%. Remained the same
#43

push

github

hazendaz
[tests] Fix tests given they expected order and now license on everything for +36

1437 of 1625 relevant lines covered (88.43%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/carrot2/labs/smartsprites/SmartSprites.java
1
/*
2
 * SmartSprites Project
3
 *
4
 * Copyright (C) 2007-2009, Stanisław Osiński.
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms, with or without modification,
8
 * are permitted provided that the following conditions are met:
9
 *
10
 * - Redistributions of  source code must  retain the above  copyright notice, this
11
 *   list of conditions and the following disclaimer.
12
 *
13
 * - Redistributions in binary form must reproduce the above copyright notice, this
14
 *   list of conditions and the following  disclaimer in  the documentation  and/or
15
 *   other materials provided with the distribution.
16
 *
17
 * - Neither the name of the SmartSprites Project nor the names of its contributors
18
 *   may  be used  to endorse  or  promote  products derived   from  this  software
19
 *   without specific prior written permission.
20
 *
21
 * - We kindly request that you include in the end-user documentation provided with
22
 *   the redistribution and/or in the software itself an acknowledgement equivalent
23
 *   to  the  following: "This product includes software developed by the SmartSprites
24
 *   Project."
25
 *
26
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"  AND
27
 * ANY EXPRESS OR  IMPLIED WARRANTIES, INCLUDING,  BUT NOT LIMITED  TO, THE IMPLIED
28
 * WARRANTIES  OF  MERCHANTABILITY  AND  FITNESS  FOR  A  PARTICULAR  PURPOSE   ARE
29
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE  FOR
30
 * ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  DAMAGES
31
 * (INCLUDING, BUT  NOT LIMITED  TO, PROCUREMENT  OF SUBSTITUTE  GOODS OR SERVICES;
32
 * LOSS OF USE, DATA, OR PROFITS;  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND  ON
33
 * ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY,  OR TORT
34
 * (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY WAY  OUT OF THE USE  OF THIS
35
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
 */
37
package org.carrot2.labs.smartsprites;
38

39
import java.io.IOException;
40

41
import org.carrot2.labs.smartsprites.message.MessageLog;
42
import org.carrot2.labs.smartsprites.message.PrintStreamMessageSink;
43
import org.kohsuke.args4j.CmdLineException;
44
import org.kohsuke.args4j.CmdLineParser;
45
import org.kohsuke.args4j.ParserProperties;
46

47
/**
48
 * The entry class for SmartSprites.
49
 */
50
public class SmartSprites
×
51
{
52
    /**
53
     * Entry point to SmartSprites. All parameters are passed as JVM properties.
54
     */
55
    public static void main(String [] args) throws IOException
56
    {
57
        final SmartSpritesParameters parameters = new SmartSpritesParameters();
×
58

59
        final ParserProperties parserProperties = ParserProperties.defaults();
×
60
        parserProperties.withUsageWidth(80);
×
61

62
        final CmdLineParser parser = new CmdLineParser(parameters, parserProperties);
×
63

64
        if (args.length == 0)
×
65
        {
66
            printUsage(parser);
×
67
            return;
×
68
        }
69
        
70
        try
71
        {
72
            parser.parseArgument(args);
×
73
        }
74
        catch (CmdLineException e)
×
75
        {
76
            printUsage(parser);
×
77
            System.out.println("\n" + e.getMessage());
×
78
            return;
×
79
        }
×
80
        
81
        // Get parameters form system properties
82
        final MessageLog messageLog = new MessageLog(new PrintStreamMessageSink(
×
83
            System.out, parameters.getLogLevel()));
×
84
        new SpriteBuilder(parameters, messageLog).buildSprites();
×
85
    }
×
86

87
    private static void printUsage(final CmdLineParser parser)
88
    {
89
        System.out.print("Usage: smartsprites");
×
90
        parser.printSingleLineUsage(System.out);
×
91
        System.out.println();
×
92
        System.out.println("\nPlease see http://csssprites.org for detailed option descriptions.");
×
93
    }
×
94
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc