source: branches/maven/projects/autogen/src/main/scripts/gen-meta-support.sh @ 6913

Revision 6913, 2.8 KB checked in by curtis, 9 years ago (diff)

Begin migration of autogen project to Maven.

Line 
1#!/bin/bash
2
3baseDir="$1/components"
4outputFile="$baseDir/autogen/src/meta-support.txt"
5commonClasses="$baseDir/bio-formats/src/loci/formats/MetadataTools.java"
6XML_ELEMENTS=`ls $baseDir/ome-xml/src/ome/xml/model/*.java | sed -e 's/.*\///' -e 's/\.java//'`
7HEADER='#\n# meta-support.txt\n#\n\n# LOCI autogen package for programmatically generating source code.\n# Copyright (C) 2005-@year@ UW-Madison LOCI and Glencoe Software, Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   02111-1307   USA\n\n# This file documents the metadata support for each file format that\n# Bio-Formats can handle. Default value for unlisted properties is Missing,\n# indicating that the property cannot be represented in the format, or our\n# knowledge regarding the property regarding this format is incomplete.\n\n# To define the status of a property, use the syntax:\n#\n#     Entity.Property = Status [Comment]\n#\n# "Status" is one of Yes, No, Partial or Missing.\n# There is usually no need to specify Missing status, as it is the default.\n#\n# "Comment" is optional extra text for specifying further details, such as\n# when the status changed. This value can include a revision, a ticket, a\n# datestamp or any other appropriate information.\n#\n# As a shortcut for every property of a given entity, you can write:\n#\n#     Entity [Comment]\n#\n# Examples:\n#\n#     Dimensions = Yes since r2351\n#     Objective.NominalMagnification = Yes added on 2008 Jan 8\n#     ImagingEnvironment.Temperature = Partial see ticket #167 for details'
8
9rm $outputFile
10echo -e $HEADER >> $outputFile
11
12for reader in $baseDir/bio-formats/src/loci/formats/in/*Reader.java
13do
14  echo [`echo $reader | sed -e 's/.*\///' -e 's/\.java//'`] >> $outputFile
15  for line in `grep store.set $reader $commonClasses | sed -e 's/.*store\.set//' -e 's/(.*//' | sort | uniq`
16  do
17    matchingElement=''
18    for element in $XML_ELEMENTS
19    do
20      if expr "$line" : "^$element" > /dev/null
21      then
22        matchingElement=$element
23      fi
24    done
25
26    if [ ${#matchingElement} != 0 ]
27    then
28      echo $matchingElement.${line#$matchingElement} = Yes >> $outputFile
29    fi
30  done
31  echo >> $outputFile
32done
Note: See TracBrowser for help on using the repository browser.